0

Is there a way to configure some policy to redirect messages from one exchange to another exchange, if the current exchange doesn't have any binded queue?

I got a situation where RabbitMQ after restart loose some bindings and my messages were gone.

Uriu
  • 51
  • 6

1 Answers1

1

Yes, the feature is called Alternate Exchanges, and it works like this:

  • You set a "policy" which matches exchange A, with a key of 'alternate-exchange' and a value naming exchange B. Alternatively, you can set it as a property directly when creating the exchange.
  • Any message routed to exchange A which doesn't match any binding will be routed to exchange B.
  • Exchange B processes it in the normal way, and can even have an Alternate Exchange of its own.
IMSoP
  • 89,526
  • 13
  • 117
  • 169