Bug #59877 [Opn->Csd]: AMQP_NOACK on AMQPQueue::get not respected
| From: | pdezwart@php.net | Date: | Mon, 17 Oct 2011 04:04:29 +0000 |
| Subject: | Bug #59877 [Opn->Csd]: AMQP_NOACK on AMQPQueue::get not respected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164367@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
Updated by: pdezwart@php.net
Reported by: luke at lukelanchester dot com
Summary: AMQP_NOACK on AMQPQueue::get not respected
-Status: Open
+Status: Closed
Type: Bug
Package: amqp
Operating System: OS X 10.6.2
PHP Version: 5.3.2
-Assigned To:
+Assigned To: pdezwart
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is actually the expected behavior. Providing the AMQP_NOACK flag indicates that you will not be
ack'ing the message, and that the server should instead ack it as soon as it sends it off to
the client. Unfortunately, there is a bug in that you cannot get/consume without acking. This will
be fixed in trunk shortly and be part of the 0.4.* release.
Previous Comments:
------------------------------------------------------------------------
[2011-10-11 06:13:42] php at aotd dot ru
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.
------------------------------------------------------------------------
[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