Skip to main content
InterviewHubPRO
Section Overview
Q47

Question 47 of 50

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

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

RabbitMQ Message TTL and Queue Expiration (`x-message-ttl` vs `x-expires`).

senior LevelSystem DesignRabbitMQMicroservices

In Simple Words:

  • x-message-ttl: Lifespan of individual messages in milliseconds. If a message remains unconsumed past its TTL, it is dropped or forwarded to a Dead Letter Exchange.
  • x-expires: Lifespan of the queue itself. If a queue is unused (no active consumers and no messages published) for the specified duration (e.g. 2 hours), RabbitMQ automatically deletes the queue to prevent orphaned queue buildup in ephemeral client environments.