What is the main purpose of a dead letter exchange (DLX) in RabbitMQ?
Think about what happens to messages that fail processing or expire.
Dead letter exchanges are used to catch messages that are rejected, expired, or cannot be routed, so they can be inspected or retried later.
What is the output or effect of running this RabbitMQ CLI command?
rabbitmqadmin declare queue name=myqueue durable=true arguments='{"x-dead-letter-exchange":"dlx-exchange"}'Check how the 'arguments' parameter is used to set dead letter exchange.
The command creates a durable queue with a dead letter exchange set, so messages rejected or expired from 'myqueue' go to 'dlx-exchange'.
Which sequence of steps correctly sets up a dead letter exchange and queue in RabbitMQ?
Think about the order: exchanges and queues must exist before binding and usage.
You must first create the DLX, then the DLQ and bind it, then configure the main queue to use the DLX, and finally publish messages.
You configured a queue with a dead letter exchange, but messages rejected from the queue do not appear in the dead letter queue. What is a likely cause?
Check bindings between exchange and queue carefully.
If the dead letter queue is not bound correctly to the dead letter exchange, messages sent to the DLX will not be routed to the DLQ.
What is the best practice for handling poison messages (messages that always fail processing) in a RabbitMQ dead letter queue setup?
Think about how to avoid infinite retry loops and keep the system healthy.
Setting a retry limit and isolating poison messages prevents infinite loops and allows manual debugging or fixing.