[rabbitmq-discuss] How to achieve HA consumers?

Matthias Radestock matthias at rabbitmq.com
Wed Sep 5 15:14:17 BST 2012


On 05/09/12 14:51, johnson wrote:
> The message-count is correct but the consumer-count is changed from 1
> to 0. I don't know why.

That is due to a subtlety in the meaning of consumer-count in the AMQP 
spec. From 
Reports the number of *active* consumers for the queue.

Rabbit's interpretation of "active consumer" is "a consumer to which a 
message can be sent". Since your consumer channels have a qos prefetch 
count of 1, once a message has been sent to a consumer no further 
messages can be sent to it until it acks the message. Until then the 
consumer is inactive and hence won't be included in the consumer-count 
returned by queue.declare-ok.

The RabbitMQ management API/UI isn't bound by AMQP semantics, so it 
always reports all consumers, active or not.



More information about the rabbitmq-discuss mailing list