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: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: work at aotd dot ru Assigned:
Status: Open Package: amqp (PECL)
PHP Version: 5.4.9 OS: Ubuntu 12.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 18 11:01:30 2019 UTC