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

Scott Chapman Scott.Chapman at servicenow.com
Wed Feb 20 23:27:11 GMT 2013


After further exploring it appears that you do this:
Using the BlockingConnection:
Receive Message
Run Handler to process message which can immediately ACK the message.
When Handler returns, next message is received from RabbitMQ.

Simpler!



From: Scott Chapman <Scott.Chapman at servicenow.com<mailto:Scott.Chapman at servicenow.com>>
Reply-To: Discussions about RabbitMQ <rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>>
Date: Wednesday, February 20, 2013 12:50 PM
To: "rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>" <rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>>
Subject: [rabbitmq-discuss] How to do blocking asynchronously with Pika? I want 1 message at a time and stop receiving until I'm ready again.

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?

Something like:

Receive Message
Turn off Channel – how best to do this?
Ack Message
Process Message
Turn on Channel
…. Back to the top.

Thanks,
Scott

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


More information about the rabbitmq-discuss mailing list