php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63672 Allow create bindings with custom Arguments
Submitted: 2012-12-03 03:29 UTC Modified: 2021-06-10 15:35 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: work at aotd dot ru Assigned: cmb (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.4.9 OS: Ubuntu 12.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: work at aotd dot ru
New email:
PHP Version: OS:

 

 [2012-12-03 03:29 UTC] work at aotd dot ru
Description:
------------
Current definitions not allow to create bindings with custom arguments (like x-
ha-policy):
public bool AMQPQueue::bind ( string $exchange_name , string $routing_key )
public bool AMQPExchange::bind ( string $source_exchange_name , string 
$routing_key , [long $flags])

Maybe modify it into:
public bool AMQPQueue::bind ( string $exchange_name , string $routing_key , array 
$arguments)
public bool AMQPExchange::bind ( string $source_exchange_name , string 
$routing_key , [long $flags, [array $arguments]])
Or inherit Arguments for binding from parent object (queue/exchange)?


Test script:
---------------
$connection = new AMQPConnection(array(	'host'  => 'localhost',	'port'  => 5672,	'vhost' => 'test,	'login' => 'guest',	'password' => 'guest));
$connection->connect();
$channel = new AMQPChannel($connection);
$queue = new AMQPQueue($channel);
$queue->setName('testQueue');
$queue->setArguments(array('x-ha-policy'=>'all'));
$queue->declare();
$exchange = new AMQPExchange($channel);
$queue->setName('testExchange');
$queue->setArguments(array('x-ha-policy'=>'all'));
$queue->declare();
$queue->bind('testExchange', 'testRoute', array('x-ha-policy'=>'all'));

Expected result:
----------------
We can't get bindings via AMQP library, so look in AMQP Broker and see new 
binding for exchange 'testExchange' and queue 'testQueue' with route 'testRoute' 
marked as 'x-ha-policy'='all'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-04 16:58 UTC] bkw at codingforce dot com
Can you supply a link to documentation about bindings also carrying x-ha-policy 
attributes? I was under the assumption exchanges and bindings are central on 
rabbitmq anyways and that it was enough to set these on the queues only, no?
 [2021-06-10 15:35 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-10 15:35 UTC] cmb@php.net
The amqp bug tracker is now on Github[1].  If this is still an
issue, please report there.

[1] <https://github.com/php-amqp/php-amqp/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 13:01:29 2024 UTC