[rabbitmq-discuss] Message is available in multiple queue
Alvaro Videla
videlalvaro at gmail.com
Fri Jun 3 13:35:37 BST 2011
Setting the reply_to of a message does not put the message on a queue whose name is the value of that message property.
Messages are routed based on exchanges and bindings. So you publish a message to an exchange using certain routing key. If there's a queue bound to that exchange whose binding matches the routing key you used to publish the message then the message will be delivered to said queue.
The reply_to property is usually used for RPC scenarios. You publish messages adding a reply_to value to them. Then the consumer on the other end inspects that reply_to value and publishes a reply message to the anonymous exchange (or unnamed exchange) using that reply_to property as routing key. Since every queue is bound to that anonymous exchange using its name as binding key, the message will arrive to said queue.
See: http://eaipatterns.com/ReturnAddress.html and http://www.rabbitmq.com/tutorials/tutorial-six-python.html for some sample implementation.
Regards,
-Alvaro
On Jun 3, 2011, at 2:26 PM, cheepu wrote:
>
> Hi,
>
> In my producer and consumer code Exchange Name and RouteKey name are same.
> In the producer i am setting the message property "replyTo" with the message
> queue name.
> As i think it after this message should be put in the message queue whose
> name is specified in the "reply To" property, but this message is available
> in all the queue whose name is being used in past.
> My question is: does setting the reply to property bind the message with a
> queue? If this is the case then why messages are available in multiple
> queues, and if this is not the case then how can restrict the messages to be
> put in only one queue?
>
> Thanks
> --
> View this message in context: http://old.nabble.com/Message-is-available-in-multiple-queue-tp31764872p31764872.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Sent form my Nokia 1100
More information about the rabbitmq-discuss
mailing list