[rabbitmq-discuss] Understanding the topic exchange behavior

spicoflorin at gmail.com spicoflorin at gmail.com
Thu Apr 17 09:15:13 BST 2014


Hello!
  In the tutorial about the topic 
exchange http://www.rabbitmq.com/tutorials/tutorial-five-java.html it is 
mentioned
"When a queue is bound with "#" (hash) binding key - it will receive all 
the messages, regardless of the routing key - like in fanout exchange.

When special characters "*" (star) and "#" (hash) aren't used in bindings, 
the topic exchange will behave just like a direct one."

The spotted issue is related with the last statement "When special 
characters "*" (star) and "#" (hash) aren't used in bindings, the topic 
exchange will behave just like a direct one."

Here is the scenario that contradicts this statement.

Suppose that you have:

- a producer that is sending messages using routing key "kern.critical" 

-two consumers that are consuming using the same routing 
key "kern.critical".

In my understanding, the behavior for this case should be, that the 
consumers will consume in a round robin fashion messages (direct exchange). 
In reality, both consumers will receive the same sent messages, and that is 
not the case of direct exchange contract. 

1. Is this an issue of the documentation or my understanding is wrong?

2. When using the topic exchange, all the consumers that are listening to a 
specific bounded queue will receive  the same messages. In the given 
example from the tutorial, if Q1 has two consumers, then both of them will 
receive same sent messages. Is it possible when have multiple consumers to 
consume in a round robin fashion?

I look forward for your answers.

Thank you very much.

Regards,

Florin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140417/57aaa425/attachment.html>


More information about the rabbitmq-discuss mailing list