[rabbitmq-discuss] How can get the queue depth?
Rob Harrop
rob at rabbitmq.com
Fri Mar 4 11:32:00 GMT 2011
Try:
Channel c = createChannel();
AMQP.Queue.DeclareOK ok = c.queueDeclarePassive("my.queue");
int messageCount = ok.getMessageCount();
On 04/03/11 06:33, sam_mis wrote:
> could you explain more detailed(idea,code) for using
> Channel.queueDeclarePassive
> .
>
> Thanks
>
>
> Michael Bridgen-3 wrote:
>>> I am using Java Client for Rabbitmq. I want know that how many messages
>>> are
>>> in the queue(total no. of message remaining in the queue) without reading
>>> the message of the queue.
>> Using a passive declare (Channel.queueDeclarePassive in the Java client)
>> will give you the queue depth in the reply.
>>
>> If you want to sample it often, it may be better to use the management
>> plugin.
>>
>> Michael.
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
More information about the rabbitmq-discuss
mailing list