[rabbitmq-discuss] Active consumers in declare-ok is less than the actual number of consumers

Gerolf Seitz gerolf.seitz at gmail.com
Tue Mar 20 06:43:51 GMT 2012


Hi,

When passively declaring a queue, the returned consumer count is not the
same as the consumer count via the management plugin / http API. Turns out,
rabbitmq returns the number of consumers that are ready to receive a
message.

As an example: there are 5 (manually acknowledging) consumers, 3 of which
have consumed a message from the queue, but have not sent an ACK for the
respective messages to the broker. Declaring a queue now returns a
declare-ok with consumer-count == 2, whereas I would have expected it to be
5.

Looking at the rabbitmq-server code reveals that the "active consumer" part
of the state is used for getting the next consumer for round robin delivery
and returning the number of consumers as part of the declare-ok message.

Since I don't suspect this to be an oversight but rather a conscious
decision, I'm interested in the rationale behind it. I'm aware that
changing the semantics at this point is probably not possible and I may
have to resort to fetching the consumer count via the http api (which
brings some organizational overhead).

Can anybody shed some light on this?

Cheers,
  Gerolf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120320/81c4d6fa/attachment.htm>


More information about the rabbitmq-discuss mailing list