rabbitmqrabbitmq-exchange

RabbitMQ dead letter exchange - route by "x-death.reason" or "x-first-death-reason" header


I am trying to set up RabbitMQ to route messages through a Dead Letter Exchange based on the death reason (either "x-death.reason" or "x-first-death-reason" would do).

My understanding is that when a message dies that "x-death.reason" and "x-first-death-reason" are set as headers when the messages is sent to the DLX. So my reasoning is that I should be able to set up an exchange with type=headers to be able to route by the value of these headers.

Unfortunately, I just can't get it to work.

The DLX is set up like

dead letter queue setup

However each dead message gets routed to all of the bound queues.

target queues

i.e. the filtering/routing is not working.

Can someone please let me know how to configure this correctly.

Thanks


Solution

  • From: https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchange-headers

    Note that headers beginning with the string x- will not be used to evaluate matches.