php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63346 AMQPQueue::bind() second parameter should be optional.
Submitted: 2012-10-24 11:18 UTC Modified: 2012-12-21 01:05 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: andre dot torgal at gmail dot com Assigned: lstrojny (profile)
Status: Closed Package: amqp (PECL)
PHP Version: Irrelevant OS: irrelevant
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andre dot torgal at gmail dot com
New email:
PHP Version: OS:

 

 [2012-10-24 11:18 UTC] andre dot torgal at gmail dot com
Description:
------------
RabbitMQ ignores the RoutingKey altogether when binding the queue to an exchange 
of type FANOUT

http://www.rabbitmq.com/tutorials/amqp-concepts.html#exchange-fanout

It would be great to have the $routingKey parameter made optional instead of 
having to type "foobar" or "ignored".

The broker, being used (RabbitMQ, other) should then handle pre-conditions to 
make the bind() effective.

---
From manual page: http://www.php.net/amqpqueue.bind
---


Test script:
---------------
$ex = new AMQPExchange($ch);
$ex->declare('exchange1', AMQP_EX_TYPE_FANOUT);

// Create a new queue
$q = new AMQPQueue($ch);
$q->declare('queue1');

// Bind it on the exchange to routing.key
$ex->bind('queue1');

Expected result:
----------------
Queue is bound to exchange.

Actual result:
--------------
Uncaught exception 'AMQPExchangeException' with message 'Could not bind exchange. 
No routing key given.'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-04 17:01 UTC] bkw at codingforce dot com
Thanks for reporting this, this has been fixed in the development version, see 
here: https://github.com/pdezwart/php-amqp/pull/32

This will be in the next released version.
 [2012-12-21 01:05 UTC] lstrojny@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: lstrojny
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC