[rabbitmq-discuss] Fanout exchange doesnt publish to all consumers

Emile Joubert emile at rabbitmq.com
Mon Jun 18 10:24:24 BST 2012


Hi Max,

On 17/06/12 09:27, Max Beutel wrote:
> It looks like the messages are distributed using round robin or the
> like, consumer 1 gets message 1, consumer 2 gets message 2 etc.
> 
> Is fanout the wrong exchange for this? Or is something wrong in my setup
> code?

A fanout exchange will route messages to all bound queues, but you only
have one queue. You want something like tutorial 3:
http://www.rabbitmq.com/tutorials/tutorial-three-python.html

But your code sets up something that looks like tutorial2:
http://www.rabbitmq.com/tutorials/tutorial-two-python.html

If each consumer declares and binds its own queue then you should see
each consumer receiving all messages.

-Emile



More information about the rabbitmq-discuss mailing list