Doc #60031 [Opn->Bgs]: incorrect document and example
| From: | frozenfire@php.net | Date: | Sat, 03 Dec 2011 19:23:26 +0000 |
| Subject: | Doc #60031 [Opn->Bgs]: incorrect document and example | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7519@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60031&edit=1
ID: 60031
Updated by: frozenfire@php.net
Reported by: tasanakorn at gmail dot com
Summary: incorrect document and example
-Status: Open
+Status: Bogus
Type: Documentation Problem
Package: amqp
Operating System: Linux
PHP Version: 5.3.8
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 method seems to be documented correctly. Presumably, the idea behind this is
to allow one to delay acknowledgement of the receipt of a message until it has
been parsed and verified. So, one would pass AMQP_NOACK to the get method, check
the message, and then if the message is valid, acknowledge it with the ack
method.
Previous Comments:
------------------------------------------------------------------------
[2011-10-10 17:44:43] tasanakorn at gmail dot com
Description:
------------
AMQP_NOACK mean don't need to ack().
This method should used with a message this is retrieved without the AMQP_NOACK
flag.
<?php
/* Create a connection using all default credentials: */
$connection = new AMQPConnection();
$connection->connect();
/* create a queue object */
$queue = new AMQPQueue($connection);
//declare the queue
$queue->declare('myqueue');
//get the next message, but don't mark it as delivered
$message = $queue->get(0);
echo $message['msg'];
//acknowledge the message as received
$queue->ack($message['delivery_tag']);
?>
---
From manual page: http://www.php.net/amqpqueue.ack#refsect1-amqpqueue.ack-
description
---
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60031&edit=1