|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-04-30 22:23 UTC] brandon at brandonsavage dot net
[2013-04-30 22:23 UTC] brandon at brandonsavage dot net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 20:00:01 2025 UTC |
Description: ------------ I'm using PHP 5.4beta4 and RabbitMQ 2.8.4. I've noticed that if I use a script that has a consume() method, and doesn't explicitly ack, and then kill off the script, it clears the queue. Test script: --------------- <?php // Create a connection $cnn = new AMQPConnection(); $cnn->connect(); // Create a channel $ch = new AMQPChannel($cnn); // Declare a new exchange $ex = new AMQPExchange($ch); $ex->setName('new_topic_exchange'); $ex->setType(AMQP_EX_TYPE_DIRECT); $ex->setFlags(AMQP_DURABLE | AMQP_AUTODELETE); $ex->declare(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1'); $q->declare(); // Bind it on the exchange to routing.key $q->bind('new_topic_exchange', 'routing.key'); // Publish a message to the exchange with a routing key $ex->publish('message', 'routing.key'); // Read from the queue $q->consume('var_dump'); Expected result: ---------------- I expect that since I'm not ack-ing the result, the results shouldn't be purged from the queue. Actual result: -------------- ALL messages are actually purged from the queue.