php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59498 AMQPQueue::get() doesn't return the message
Submitted: 2010-11-07 15:19 UTC Modified: 2010-11-25 13:11 UTC
From: d dot kanen at gmail dot com Assigned:
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04
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:
MUST BE VALID
Solve the problem:
38 + 48 = ?
Subscribe to this entry?

 
 [2010-11-07 15:19 UTC] d dot kanen at gmail dot com
Description:
------------
When I use queue::get() it doesn?t return the message yet it 
removes it from the queue. I believe I was able to patch 
amqp.c to remedy the issue with a patch similar to the one at 
http://code.google.com/p/php-rabbit/issues/detail?id=29.

Reproduce code:
---------------
$cnn = new AMQPConnection();
$ex = new AMQPExchange($cnn);
$ex->declare('exchange1', AMQP_EX_TYPE_FANOUT);
$q = new AMQPQueue($cnn, 'queue1');
$q->declare();
$ex->bind('queue1', 'routing.key');
$ex->publish('message', 'routing.key');
echo "Number of messages before get: " .  $q->declare() . "\n";
$msg = $q->get();
echo "Number of messages after get: " . $q->declare() . "\n";
echo "message received from get: " . print_r($msg,true) . "\n";

Expected result:
----------------
Number of messages before get: 1
Number of messages after get: 0
message received from get: Array
(
    [routing_key] => routing.key
    [exchange] => exchange1
    [delivery_tag] => 1
    [Content-type] => text/plain
    [count] => 0
    [msg] => message
)

Actual result:
--------------
Number of messages before get: 1
Number of messages after get: 0
message received from get:

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-07 15:30 UTC] d dot kanen at gmail dot com
I posted the patch at http://gist.github.com/666401
 [2010-11-25 13:11 UTC] pdezwart at gmail dot com
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

This has been fixed in trunk, and will go out with the next release, which should happen by Dec 1st.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 22:01:32 2024 UTC