[rabbitmq-discuss] Load Balancing Consumers

Michael Bridgen mikeb at rabbitmq.com
Thu Sep 8 15:22:42 BST 2011


> I have a need to load balance consumers on a queue. I saw a similar
> thread last month-
> http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-August/014533.html
>
> My requirements are little different. Publisher ----> sends messages
> ---> Queue <------ 1 or more consumers listens on this queue.
>
> All my consumers are the same application. I need to load balance(simple
> round robin) the consumers so that my load gets distributed. For example
> if i have 2 consumers and publishers sends 2 messages to the queue,
> message 1 should go to consumer 1 and message 2 should to consumer 2 and
> this logic repeats.
>
> Any idea/thoughts how i can achieve this in Rabbit MQ?

This is exactly what RabbitMQ will do if you connect multiple consumers 
to a queue.  You may have to be careful with setting basic.qos.  See 
http://www.rabbitmq.com/tutorials/tutorial-two-python.html


-Michael


More information about the rabbitmq-discuss mailing list