Declare a quorum queue with a delivery limit argument: x-queue-type=quorum and x-delivery-limit=<n> where n is the maximum number of failed delivery attempts before the message is dead-lettered
Configure a dead-letter exchange on the queue so rejected messages are routed: x-dead-letter-exchange=dlx-name and x-dead-letter-routing-key=dlq-routing-key
Consume from the queue; on each redelivery the x-delivery-count header is incremented by the broker
When x-delivery-count reaches the delivery limit the message is dropped or routed to the DLX depending on whether a DLX is configured
Apply or change the limit via policy rather than queue arguments to allow live updates: rabbitmqctl set_policy quorum-dl '.*' '{"delivery-limit": 5}' --apply-to quorum_queues
Monitor the dead-letter queue for poison message accumulation using the management UI or rabbitmqctl list_queues name messages
Known gotchas
In RabbitMQ 4.3+ the delivery limit is based on x-delivery-count (failed deliveries only); explicit nack without requeueing and AMQP 1.0 modify with delivery_failed=false do not count toward the limit — verify your broker version before relying on this behaviour
x-delivery-limit set as a queue argument at declaration time cannot be changed without deleting and recreating the queue; use policies for any limit you expect to tune in production
Classic queues do not support x-delivery-limit natively; poison message handling on classic queues requires application-level counting or upgrading to quorum queues
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp