[rabbitmq-discuss] Message delivered even if routing key doen't match

Tony Garnock-Jones tonyg at lshift.net
Tue May 11 10:22:39 BST 2010


Hi Alex,

alexyz78 wrote:
> I'm starting to write a prototype with RabbitMQ but I've some problem to
> understand the concept of "routing key", below there's an excerpt of the
> producer:
> 
>     channel.queueDeclare(queueName);
>     channel.queueBind(queueName, exchangeName, routingKey);

It seems a bit odd that a producer is declaring a queue at all. Information
flow in AMQP is asymmetric. Producers send messages to exchanges, which route
on to queues, which deliver to consumers. A producer doesn't need to declare or
manipulate queues: if one piece of code both publishes to an exchange and reads
off a queue, it's performing in both the producer and the consumer roles.

Not sure if this sheds any light on your issue of course :-)

Tony




More information about the rabbitmq-discuss mailing list