[rabbitmq-discuss] To know when a queue is empty from a Java client

Jon Brisbin jon at jbrisbin.com
Thu Aug 26 14:25:55 BST 2010


The "official" folks should correct me here, but when you declare an existing queue, you get an object back that gives you the message count:

http://www.rabbitmq.com/releases/rabbitmq-java-client/v2.0.0/rabbitmq-java-client-javadoc-2.0.0/com/rabbitmq/client/AMQP.Queue.DeclareOk.html

I don't think there's a way to poll for the message count on a long-running process, though...

jb


On Aug 26, 2010, at 8:16 AM, Florence Chabanois wrote:

> Hello,
> 
> From a Java client we need to know when a queue is empty.
> Is there a way to know it via the Java api (or to know the number
> of messages in a queue).
> 
> We would rather have another way than calling "rabbitmqctl list_queues"
> via Runtime.exec()
> 
> Thanks for any help,
> Florence.
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


Thanks!

J. Brisbin
http://jbrisbin.com/






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100826/58c94e5e/attachment.htm>


More information about the rabbitmq-discuss mailing list