x-death
AMQP 0-9-1 metadata used to detect poison messages.
Definition
When a message is dead-lettered, RabbitMQ enriches its headers with an x-death array holding, per queue/reason pair, a count, the reason (rejected, expired, maxlen), the originating queue and a timestamp. A consumer reads this counter to decide when to abandon a message after N rejections — the broker-side poison-message detection mechanism.
Origin
Defined by RabbitMQ's dead-lettering extension to the AMQP 0-9-1 protocol (official "Dead Letter Exchanges" documentation). The JMS-side equivalent is the JMSXDeliveryCount header in the Jakarta Messaging specification.
Example in context
x-death: [{count: 3, reason: 'rejected', queue: 'invoices', exchange: '', time: ...}]
Related terms
- Poison message — what x-death helps spot.
- DLQ — queue fed on dead-lettering.