RabbitMQ / Intermediate: replicated work, retry safety and operational evidence / Lesson 14
Quarantine review and controlled redrive
Preserve failed-message evidence and plan a bounded, duplicate-safe redrive.
On this page
Lesson goals
- Distinguish quarantine from successful business completion.
- Design a reviewed redrive with stable identity and destination reconciliation.
Treat quarantine as an unfinished outcome
A dead-letter or quarantine path can stop an invalid message from repeatedly blocking normal work, but it does not complete the underlying business operation. Define the owner, retention, failure reason and evidence needed to decide whether a message can be retried. Broker dead-letter behavior and safety depend on queue type and configuration; inspect the deployed version and topology rather than assuming an automatic repair.
Inspect a synthetic failure record
The first fixture records one unsupported-version failure with three attempts. It is an application incident representation, not a claim about a broker-generated header or a live queue. Preserve the original occurrence identity, sanitized source and destination context and the reason for quarantine. Avoid copying secrets or sensitive payloads into a broadly accessible ticket or log.
{"event_id":"evt-7","reason":"unsupported-version","attempts":3,"disposition":"quarantined"}
The record identifies unfinished work and its reason without accessing RabbitMQ.
Review the redrive decision
The second fixture records a hypothetical decision to retry one synthetic message after a consumer correction. Before any real redrive, verify the original failure is understood, the destination can recognize the same occurrence and the selected route is correct. A corrected consumer can still repeat an external effect if the first attempt completed before acknowledgment. Reconcile uncertain effects with the business owner.
{"event_id":"evt-7","review":"corrected-consumer-ready","redrive_scope":"one-synthetic-message"}
The fixture limits scope to one synthetic message and retains the event identity.
Prevent another failure loop
Review bindings, dead-letter routes, attempt limits and terminal disposition for the selected queue. Test an intentionally still-invalid payload in an isolated virtual host and confirm it returns to an inspectable terminal path rather than cycling indefinitely. Do not purge a production queue or republish a large batch merely to reduce a dashboard count; preserve the original evidence until reconciliation is complete.
Verify the business effect
In a disposable destination, process the synthetic message once and repeat the same identity after an interruption near acknowledgment. Confirm the destination’s durable result and documented duplicate response, then test a distinct legitimate event. Record the original and redrive identities, route and observed final state. A confirmed publish or empty quarantine queue alone does not prove correct business completion.
Common errors and fixes
A quarantined message is marked complete.
- Why it happens
- Operational disposition was confused with business completion.
- How to fix it
- Assign an owner and reconcile the intended operation.
- Prevent it next time
- Track quarantined work to a terminal business decision.
Redrive repeats an external effect.
- Why it happens
- The original attempt was not reconciled.
- How to fix it
- Use the destination’s stable idempotency contract.
- Prevent it next time
- Test the effect-to-acknowledgment interval.
A redriven message loops indefinitely.
- Why it happens
- The original invalid condition and terminal route were unchanged.
- How to fix it
- Stop the loop and correct the responsible boundary.
- Prevent it next time
- Test bounded failure and quarantine routing.
2 practice exercises
1. The fixture is quarantined after three attempts. Is the order complete?
Show worked solution
Not necessarily. The record only reports an operational disposition. Inspect the destination and have the business owner decide whether to repair, retry or explicitly resolve the unfinished operation.
2. Why retain evt-7 during redrive?
Show worked solution
It identifies the same business occurrence. A stable identity lets the destination recognize an already-applied effect; a new identity could make a duplicate appear legitimate.
Key takeaways
- Quarantine preserves failed work for a business decision.
- Redrive a reviewed scope with stable identity and verified destination effects.