[rabbitmq-discuss] Redeliever message with path in exchange to exchange binding

Matthias Radestock matthias at rabbitmq.com
Sun Oct 7 08:22:41 BST 2012


Son,

On 05/10/12 21:42, Son Tran-Nguyen wrote:
> I am trying to write a custom exchange type in which when bound to
> another exchange, it will change the message so that the final queue
> will also know which path the message were routes to.

Message routing determines the destinations of messages. It does not 
deliver the messages to these destinations, nor can it alter the messages.

Take a look at the signature of exchange:route/2:

route(rabbit_types:exchange(), rabbit_types:delivery()) ->
         rabbit_router:match_result()

where

rabbit_router:match_result() :: [rabbit_types:binding_destination()]

rabbit_types:binding_destination() ::
         rabbit_amqqueue:name() | rabbit_exchange:name()

i.e. route/2 returns a list of exchanges and queues.


So what you are trying to do simply cannot be done.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list