|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59877 AMQP_NOACK on AMQPQueue::get not respected
Submitted: 2011-08-01 07:33 UTC Modified: 2011-10-17 04:04 UTC
From: luke at lukelanchester dot com Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.2 OS: OS X 10.6.2
Private report: No CVE-ID: None
 [2011-08-01 07:33 UTC] luke at lukelanchester dot com
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:

// Example borrowed from

$exchangeName = 'myexchange';
$routingKey = 'routing.key';
$queueName = 'myqueue';

// connect
$connection = new AMQPConnection();

// setup our queue
$q = new AMQPQueue($connection);

// Bind it on the exchange to routing.key
$q->bind($exchangeName, $routingKey);

// show the message

// Should return same message in theory


Expected result:
Same message returned as previous get() not acknowledged

Actual result:
The next message in the queue and queue count decremented by 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-28 04:43 UTC] qwaser at gmail dot com
Confirmed on PHP 5.3.5 and amqp 0.3.1
 [2011-10-11 06:13 UTC] 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() 
When you disconnect all unacknowledged messages drop this flag and can be fetched 
by get() again.
 [2011-10-17 04:04 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: pdezwart
 [2011-10-17 04:04 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 02:03:34 2021 UTC