[rabbitmq-discuss] check if queue is empty?

Mark K mkovachmcse at aol.com
Wed Sep 21 15:30:56 BST 2011


Gavin M. Roy <gmr at ...> writes:

> 
> You can do a queue.declare('queue_name', passive=True) and get the results of 
that which will have the
> queue depth.
> 
> On Tuesday, July 5, 2011 at 9:05 PM, Vinod Sharma wrote:
> 
> > Hi,
> > I am new to rabbitMQ. I am using python pika module to communicate
> > with rabbitMQ server.
> > is there a function in pika to tell if the message queue is empty or
> > not??
> > 
> > Thanks,
> > Vinod
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at ... (mailto:rabbitmq-discuss at ...)
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 
> 


THank you for the example. I noticed one thing.... the 
status.method.message_count doesn't always match the number in the queue. For 
example I have a situation now where there is one message in the queue, and I 
can get an accurate count using the Rabbitmq api/queues but the status.method 
reports no messages in the same queue.



More information about the rabbitmq-discuss mailing list