Bug #59877 [Com]: AMQP_NOACK on AMQPQueue::get not respected

From: Date: Tue, 11 Oct 2011 06:13:42 +0000
Subject: Bug #59877 [Com]: AMQP_NOACK on AMQPQueue::get not respected
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-8699@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=59877&edit=1 ID: 59877 Comment by: php at aotd dot ru Reported by: luke at lukelanchester dot com Summary: AMQP_NOACK on AMQPQueue::get not respected Status: Open Type: Bug Package: amqp Operating System: OS X 10.6.2 PHP Version: 5.3.2 Block user comment: N Private report: N New Comment: It's not a bug, but normal situation. $q->get(AMQP_NOACK) set NOACK flag for message and it _skipped_ by next get() commands. When you disconnect all unacknowledged messages drop this flag and can be fetched by get() again. Previous Comments: ------------------------------------------------------------------------ [2011-09-28 04:43:53] qwaser at gmail dot com Confirmed on PHP 5.3.5 and amqp 0.3.1 ------------------------------------------------------------------------ [2011-08-01 07:33:43] luke at lukelanchester dot com Description: ------------ When using AMQPQueue to read messages, it reads messages correctly. However, using the AMQP_NOACK flag seems to have no effect as messages are still being acknowledged. It appears others have experienced this as well (search StackOverflow). Reproduce code: --------------- <?php // Example borrowed from http://www.php.net/manual/en/amqp.examples.php#104117 $exchangeName = 'myexchange'; $routingKey = 'routing.key'; $queueName = 'myqueue'; // connect $connection = new AMQPConnection(); $connection->connect(); // setup our queue $q = new AMQPQueue($connection); $q->declare($queueName); // Bind it on the exchange to routing.key $q->bind($exchangeName, $routingKey); // show the message print_r($q->get(AMQP_NOACK)); // Should return same message in theory print_r($q->get(AMQP_NOACK)); $connection->disconnect(); Expected result: ---------------- Same message returned as previous get() not acknowledged Actual result: -------------- The next message in the queue and queue count decremented by 1. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=59877&edit=1

« previous php.pecl.dev (#8699) next »