0

if I am sending a message onto a multicast topic using:

TibrvMsg replyMessage = TibRvdTransport.sendRequest(message,timeout)

and there are two subscribers, which one actually sends the replyMessage, and what happens to the other replyMessage ?

I can only guess the fastest one that that answers. But I cannot see this documented anywhere.

dasPing
  • 337
  • 1
  • 2
  • 19

1 Answers1

2

Since your components are decoupled, they are unaware of each other. Rendezvous is pub-sub, which means that all subscribers receive all messages published to subjects that they have subscribed to. Furthermore, Rendezvous uses a peer-to-peer messaging approach vis-a-vis a centralized message forwarding approach. Therefore both components will receive the message and both components will reply.

If this is not the desired behavior, with Rendezvous you can use a distributed queue (RVDQ). With that approach a "scheduler" assigns work to workers, ensuring that messages get processed only once.

nochum
  • 755
  • 4
  • 10
  • I can work with the behavior, but what seems strange to me is that in theory any reply after the fastest one just gets lost. When I first used the method I was not expecting pub-sub behavior, because in java at least if you make a method call you expect only one answer back. – dasPing Feb 13 '15 at 13:25