php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59917 Cannot get the name for auto-named reply-to queues
Submitted: 2011-08-30 13:48 UTC Modified: 2011-09-08 02:02 UTC
From: anthony at hildoersystems dot com Assigned:
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.3 OS: Ubuntu
Private report: No CVE-ID: None
 [2011-08-30 13:48 UTC] anthony at hildoersystems dot com
Description:
------------
There should be a way to get the queue name from an AMQPQueue 
object after a declare. This is because, if declare is called 
with an empty string for queue name, then the server creates 
an auto-generated queue name. This is very useful for RPC in 
amqp. But, currently, there is no way to get the queue name 
from a queue object, only set it. 

Reproduce code:
---------------
$conn = new \AMQPConnection();
$conn->connect();

$ex = new \AMQPExchange($conn);
$ex->declare('rpc_reply_queues', AMQP_EX_TYPE_DIRECT, AMQP_DURABLE);

$q = new \AMQPQueue($conn);

$q->declare('', AMQP_AUTODELETE | AMQP_EXCLUSIVE);

$queueName = ""; // this is where we need to be able to get the queue name

$ex->bind($queueName, $queueName);

// while we are sleeping, go run list_queues on your management console in your amqp server, you will see at least one amq.gen- (or something similar) queue(s)
sleep(60);
exit;

Expected result:
----------------
I expect it to generate an auto-named queue on the server, 
which it does. I would then like a way to get the name of that 
queue from the $q object so I can set the $queueName variable.

Actual result:
--------------
There is no way to get the queue name from the $q object.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-08 02:02 UTC] pdezwart at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/amqp

Fixed in release 0.3.1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC