[rabbitmq-discuss] same routing key for multiple queue bindings in multiple exchanges

Marek Majkowski majek04 at gmail.com
Thu Nov 4 12:58:53 GMT 2010

On Thu, Nov 4, 2010 at 11:11, JETZER Adrian <adrian.jetzer at efgfp.com> wrote:
> I just wanted to confirm an "issue" I just discovered.
> It looks to me that routing keys must be unique in the entire broker. We
> use the same routing-key-name for two queue bindings.
> channel.queueBind("queue1", "exchange_a", "routing_key");
> channel.queueBind("queue2", "exchange_b", "routing_key");
> The request we send to the "routing_key" gets sometimes picked up also
> by "queue2", although we say "exchange_a" in the basicPublish command.
> channel.basicPublish("exchange_a", "routing_key", props, body);
> So is this a bug or a feature?

I'm pretty sure it's a problem with your application.

In the configuration you've presented, message published
to "exchange_a" with "routing_key" will be delivered to "queue1".
And to "exchange_b" with "routing_key" will be delivered to "queue2".

You can list your queues/bindings/exchanges using the `rabbitmqctl` tool:
sudo rabbitmqctl list_queues
sudo rabbitmqctl list_bindings
sudo rabbitmqctl list_exchanges

You can also use our management plugin to get a www interface to
similar things: http://www.rabbitmq.com/management.html


More information about the rabbitmq-discuss mailing list