[rabbitmq-discuss] check if queue is empty?

vinod sharma vinodsharma.mimit at gmail.com
Wed Jul 6 03:38:26 BST 2011


Thanks Gavin for the response. I already got the answer but was not able to
post the message.
Here is what i did:Similar to what you have suggested.

status = channel.queue_declare(queue=msgqueue)
if status.method.message_count == 0:
    print "queue empty"


On Tue, Jul 5, 2011 at 7:34 PM, Gavin M. Roy <gmr at myyearbook.com> wrote:

> 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 lists.rabbitmq.com (mailto:
> rabbitmq-discuss at lists.rabbitmq.com)
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
>


-- 
Regards,
--------------------------------
Vinod Sharma
http://securitygyan.com
McAfee Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110705/6b967551/attachment.htm>


More information about the rabbitmq-discuss mailing list