Skip to main content
InterviewHubPRO
Section Overview
Q46

Question 46 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

92%
RabbitMQ & AMQP (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Dead Letter Exchange (DLX) Routing: `x-dead-letter-exchange` and `x-dead-letter-routing-key` headers preservation.

senior LevelRoutingSystem DesignRabbitMQ

In Simple Words: When a message is rejected (basic.reject), expires (TTL), or exceeds queue length limits:

  • RabbitMQ forwards the message to the exchange configured in x-dead-letter-exchange.
  • x-death Header: RabbitMQ automatically appends a diagnostic array to the message header containing:
    • Reason for death (rejected, expired, maxlen).
    • Queue where the death occurred.
    • Original routing keys and precise epoch timestamp.
    • Number of times dead-lettered.