News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mfana Ronald Conco's Blog:
RabbitMQ and PHP Part 2 - Durable Queues and Persistent Messages
March 22, 2012 @ 13:39:56

Mfana Ronald Conco has posted the second part of his RabbitMQ and PHP series to his blog today. This time he looks at durable queues and persistent messages

You now have a queuing system that works and generates pdfs which are sent to users as per RabbitMQ and PHP Part 1 of this article. A week later after launching the queuing system you get one or two queries from users who claim to have made a request to get the pdf report but it never arrived. Okay, what could have happened ? well you go through the application log files and as suspected - An Exception was thrown by one your classes as the consumer was trying to create the pdf and that is why it was never sent. Now this compromises the queuing system Totally, But wait there is a way to help prevent such.

He shows how to make your queues "durable", meaning they'll survive a broker restart and they require a response from the consumer before being removed. He shows how (via the php-ampq functionality) to add the "AMPQ_DURABLE" flag to the queue definition. He also includes some code showing how to send back the acknowledgement so the entry can be removed from the queue. He also includes an update to the code that calls "publish" to make the messages persistent too.

0 comments voice your opinion now!
rabbitmq tutorial extension phpampq durable queue persistent message


blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky's Blog: MySQL Binaries and cURL/http extensions in PHP

DevShed: Building Your Own System Tray Application Using PHP-GTK

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 5)

AWS PHP Development: Testing Webhooks Locally for Amazon SNS

Dave Marshall: Silex Route Helpers for a Cleaner Architecture


Community Events





Don't see your event here?
Let us know!


refactor unittest language framework code list opinion community threedevsandamaybe interview podcast release developer introduction install api testing laravel series symfony2

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework