[rabbitmq-discuss] Why each time the call method channel.queueDeclarePassive(queueName) increment number of consumer?

Simon MacMullen simon at rabbitmq.com
Tue Dec 14 10:14:10 GMT 2010

On 13/12/10 23:34, Pascal Dergane wrote:
> Hi,
> I don't understand something about getConsumerCount() method.
> Following an example of my consumer Method according with tutorial. Each
> time my loop call queueDeclarePassive, the consumerCounter is
> incremented. I don't understand why, cause I re use always (each loop)
> the same consumer, so I expect that the  consumerCounter does not
> increment. Could you explain these observation and confirm that is not a
> bug? (I use V2.2.0 of java client with 2.2.0 rabbitMQ Server).
> Thanks,

Hi Pascal. Each time you're going through the while loop you're issuing 
basic.consume - that will set up a new consumer. basic consume means 
"send me messages until further notice", so you don't need to issue it 
more than once per queue.

Cheers, Simon
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware

More information about the rabbitmq-discuss mailing list