0

QPID AMQP

I have a question regrading network traffic . suppose I have a Publisher on Machine A . The Qpid broker is running on Machine B . WE have two subscribers Machine C and Machine D (They both subscribe to same topics). Now Imagine a topology where
A-->B-->X-->C | D (Publisher A is connected to B and subscriber C and D are connected to Broker through and intermediate node X) Message that is published by A which matches the topics for C and D will be received by both .What I want to know is that will the edge b->x carry the message twice (once for b->x->c and second time for b->x->c). Or is the AMQP/qpid framework intelligent enough to send message once from B to X and then send copies to each individual subscriber (hence less network traffic on b->x). What I thought was that since X knows nothing and if we have private subscription queues for each subscriber (or even if shared queue and browsing/copying message instead of consuming) , the message will be travelling twice through b->x

This question is not specific to QPID . I would like to know the solutions for other Broker based (RabbitMQ ) and brokerless messaging frameworks (Zero MQ , LBM/UMS). I read in an article Zero Mq tries to provide a smarter solution http://www.250bpm.com/pubsub#toc4 , but it seems complicated since how would intermediate hops know about when to send multiple copies or not (I am not Networking expert so i might be missign something obvoius ,so any help would be really appreciated)

user179156
  • 841
  • 9
  • 31

2 Answers2

1

I'm assuming X is another Qpid broker, connected to B through the 'federation' feature. That being the case, the message will not be transported twice from B to X.

There are different ways you can configure this, depending on other requirements for the scenario.

The first is to statically link X to B: you create a queue on B for X to subscribe to, bind that Q to the exchange in question such that messages for both C and D will match, then use qpid-route to create a bridge from that queue to the exchange on X. C and D now connect and bind to that exchange on X and will receive the messages published by A as expected. In this case the messages will always flow from B to X regardless of whether C or D are active. If you add another consumer, E, then you may need to statically add a binding to the brdiged queue on B.

The second option is to use dynamic routing. This will automatically handle the propagation of binding information from X to B such that messages will only flow from B to X if they are needed by an active binding on X.

Gordon Sim
  • 21
  • 1
  • I know about federation , basically you can create a route and subscribe for the message . My question is about what if X was a random hop in the network topology , which has no idea about any qpid message or broker , it is just an intermediary hop. Will then X see the same message twice (once forwarding it to c and once to d?) – user179156 Apr 17 '12 at 13:27
0

RabbitMQ will also only propagate a message across an intermediate link such as this once (and it will only get sent at all if some downstream consumer will actually end up seeing the message).

Simon MacMullen
  • 834
  • 6
  • 3
  • I know RabbitMQ but I have no idea what your saying. I assume you mean if there is no Queue bound the message will not get sent?... Edit after reading the OP's question carefully I get it. – Adam Gent Apr 17 '12 at 11:48
  • You mean the random node x (which is not any broker , just a random hop in topology) , will be sent the subscribed message only once ? Then how does the random node x will know that it has to send to copies downstream to C and D ? how is this feature designed in broker based middleware to be smart about network topology ? This kind of makes having two subscription queues for C and D each having a copy of message at the broker somehow redundant , if only one message is ever consumed or sent down to node X just to be duplicated at X (which has no idea of any existing messaging middle-ware). – user179156 Apr 17 '12 at 13:33