|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63342 Undefined constant AMQP_NOACK
Submitted: 2012-10-23 21:14 UTC Modified: 2014-12-27 22:22 UTC
Avg. Score:4.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: andre dot torgal at gmail dot com Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.18 OS: Linux Ubuntu 2.6.32 32bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 + 8 = ?
Subscribe to this entry?

 [2012-10-23 21:14 UTC] andre dot torgal at gmail dot com
Trying to use AMQP_NOACK on AMQPQueue::consume($callback, [int $flags]) complains 
about undefined constants.

pecl/amqp is already installed and is the same as the released version 1.0.7

Using protocol version => 0-9-1

Meanwhile I found out - by using get_declared_constants() - that the current name 
for this constant should be AMQP_AUTOACK, which actually makes more sense and 
matches the amqp ini var: amqp.auto_ack => 0 => 0

Test script:
$exchangeName = 'DirectExchange';
$queueName = 'Process';
$routingKey = 'This';

// connect
$connection = new AMQPConnection();
$channel = new AMQPChannel($connection);

// configure and declare an exchange
$exchange = new \AMQPExchange($channel);

// configure and declare a queue
$queue = new \AMQPQueue($channel);

$queue->consume($callback, AMQP_AUTOACK)

Expected result:
Consume is executed and registered callback is triggered

Actual result:
PHP Notice:  Use of undefined constant AMQP_NOACK - assumed 'AMQP_NOACK'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-23 22:56 UTC]
-Status: Open +Status: Verified
 [2012-10-23 22:56 UTC]
It appears AMQP_NOACK was removed and replaced with AMQP_AUTOACK as of 1.0.0 of 
this extension, and that the  AMQPQueue::consume() documentation still refers to 
the old constant.

Proper fix: add a changelog entry that mentions this change (where? it's not 
specific to a method, but one location is fine), and replace AMQP_NOACK with 
AMQP_AUTOACK in the documentation. Steal the flags parameter description from 
another method.
 [2012-11-06 02:59 UTC]
-Assigned To: +Assigned To: pdezwart
 [2012-11-14 00:41 UTC] bkw at codingforce dot com
Thanks for reporting. The documentation is out of date unfortunately. Work is 
underway to remedy this.
 [2014-12-27 22:22 UTC]
-Status: Verified +Status: Closed
 [2014-12-27 22:22 UTC]
AMQP documentation is no longer a part of manual.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 20:03:41 2021 UTC