[rabbitmq-discuss] check if queue is empty?

Mark K mkovachmcse at aol.com
Wed Sep 21 18:35:43 BST 2011


Mark K <mkovachmcse at ...> writes:

> 
> Thanks. That makes sense. 
> Mark
> 
>
An additional question: I want to be able to spin up and down consumers as 
needed, depening on the number messages in the queue. My thought is to do this 
in the code that is the consumer, if no more messages then do a clean close and 
release the thread it runs in. I have it working to a point, but not great. Are 
there any examples of having the consumer close when "sees" there are no more 
messages in a queue without just killing a thread the ugly way? Or is my logic 
wrong on how to do something like this? I'm using this with Python 2.7. 

Thanks
Mark





More information about the rabbitmq-discuss mailing list