RabbitMQ & AMQP (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What is the Alternate Exchange (`alternate-exchange`)?
senior LevelCode ExampleSystem Design
In Simple Words: If a producer publishes a message to an exchange with a routing key that does not match any queue bindings:
- By default, RabbitMQ silently discards the message!
- To prevent silent drops, attach an Alternate Exchange:
Any unroutable messages sent tobash
rabbitmqctl set_policy AE "^orders_exchange$" \ '{"alternate-exchange": "unrouted_messages_exchange"}' --apply-to exchangesorders_exchangeare automatically forwarded tounrouted_messages_exchangefor logging and auditing.