[rabbitmq-discuss] a reliable single consumer in rabbitmq ?

Matthew Sackman matthew at lshift.net
Thu Feb 4 17:36:02 GMT 2010


On Thu, Feb 04, 2010 at 12:42:13PM +0000, mccraigmccraig wrote:
> activemq has a feature called "exclusive consumer" whereby the broker 
> delivers messages to only a single consumer of all the consumers 
> subscribed to a queue, only switching consumers when the currently 
> chosen one fails

AMQP doesn't support this use case directly. However, basic.consume does
have an exclusive flag. You can use this to ensure that no more than one
consumer successfully consumes from a queue at the same time.

The other consumers would have to poll though - maybe trying to set up
an exclusive basic.consume every 10 seconds or so; unless you have some
other way of signalling to the other consumers when the one active
consumer dies.

Matthew




More information about the rabbitmq-discuss mailing list