Skip to main content
InterviewHubPRO
Section Overview
Q40

Question 40 of 50

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

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

Handling Poison Pill Messages: Max deliver count in Quorum Queues (`x-delivery-limit`) to prevent infinite crash loops.

senior LevelSystem DesignRabbitMQData Structures

In Simple Words: A "Poison Pill" is a malformed message that triggers an unhandled exception or segment fault in the consumer:

  1. Consumer crashes or nacks with requeue: true.
  2. Broker immediately redelivers the message to another consumer.
  3. Second consumer crashes. The poison pill loops infinitely, crashing the entire worker pool!
  • Quorum Queue Solution: Set "x-delivery-limit": 5. RabbitMQ tracks delivery count in metadata. After 5 failed attempts, the broker automatically drops or dead-letters the message to quarantine.