[rabbitmq-discuss] How to do blocking asynchronously with Pika? I want 1 message at a time and stop receiving until I'm ready again.

Matthias Radestock matthias at rabbitmq.com
Thu Feb 21 00:12:12 GMT 2013


On 20/02/13 23:32, Tim Watson wrote:
> On 20 Feb 2013, at 20:50, Scott Chapman wrote:
>> What's the best practice to make it so I receive a message in a
>> single-threaded app, process it and don't get any more messages
>> until I'm ready again?
>>
>
> I would consider using basic.get with noAck=false for this.

That would require polling, i.e. repeated basic.get's when the queue is 
empty, which is undesirable. Michael's suggestion of cancelling the 
consumer works better in that regard.

Matthias.


More information about the rabbitmq-discuss mailing list