The DLQ has no owner and jobs expire
Detect: Age monitoring shows unresolved work approaching retention limits.
Recover: Assign business ownership and disposition before evidence is lost.
Quarantine repeatedly failing agent jobs with enough context for diagnosis and controlled replay, keeping poison work from blocking healthy processing.
A dead-letter queue receives work that cannot complete under its configured processing policy. It separates poison messages, persistent validation failures, and exhausted retries from the main queue so healthy work can continue. The DLQ is an operational work queue, not a permanent trash bin or a substitute for error classification.
Retain the original business operation identity, payload reference, attempt history, failure reason, and software versions. Replay must preserve idempotency and revalidate current authorization and schema compatibility. Queue-specific semantics matter: redrive thresholds, retention, ordering, and timestamps are provider-dependent and should be tested for the selected queue type.
A prototype can move a deliberately malformed job aside after a bounded number of attempts. Confirm that operators can identify why it failed.
Production defines retryable versus terminal errors, DLQ ownership, alerts, retention, and safe redrive procedures. Sensitive payloads should remain protected even when copied into diagnostic queues.
At scale, group failures by signature and deploy targeted fixes before replaying large batches. Uncontrolled redrive can recreate the original outage or overload a newly recovered dependency.
Delivers accepted agent jobs under documented visibility and redelivery semantics.
Determines whether another attempt is useful or the job should be quarantined.
Retains failed work with operation identity, evidence references, and diagnostic metadata.
Supports ownership, grouping, inspection, and disposition of failed jobs.
Revalidates and requeues selected jobs with rate limits and preserved idempotency.
flowchart LR
Q["Primary queue"] --> W["Agent worker"]
W --> S["Completed operation"]
W --> C["Failure classifier"]
C --> Q
C --> D["Dead-letter queue"]
D --> T["Triage and repair"]
T --> V["Replay validation"]
V --> R["Rate-limited redrive"]
R --> QClaim a job and apply the workflow's deadline, retry, and idempotency controls.
Distinguish transient dependency errors from invalid payloads, denied actions, and exhausted attempts.
Preserve the job and failure metadata before removing it from ordinary processing.
Alert on age, volume, or critical job classes rather than only raw queue size.
Correct code, data, or configuration and test representative failed cases.
Replay selected jobs under current policy and rate limits, retaining their business operation identities.
Supply chain finance · Illustrative enterprise scenario, not a reported customer outcome.
A distributor ingests supplier invoices through an agent that extracts fields and reconciles purchase-order references.
A supplier changes its document format, causing the same jobs to fail repeatedly and consume the main worker pool.
The assistant must isolate affected invoices while continuing to process valid suppliers and preserving recovery evidence.
The queue policy sends persistent extraction failures to a protected DLQ with document references, parser versions, and operation keys.
If an invoice already created a payable before a later stage failed, replay reconciles that payable and resumes incomplete work rather than creating another.
Track oldest failed job, failure signatures, successful redrive, duplicate-effect prevention, and business backlog age.
| Decision | Benefit | Cost |
|---|---|---|
| Separate failure queue | Poison jobs stop consuming ordinary processing capacity. | Operators need ownership and tooling to resolve the backlog. |
| Rich diagnostics | Root causes can be grouped and reproduced. | Diagnostic data increases storage and privacy responsibilities. |
| Batch redrive | Large backlogs can recover efficiently. | Excessive replay rate can overload dependencies or repeat systemic failure. |
Detect: Age monitoring shows unresolved work approaching retention limits.
Recover: Assign business ownership and disposition before evidence is lost.
Detect: Operation ledger shows an existing effect.
Recover: Reuse that result and resume only incomplete stages.
Quarantine deterministic invalid input promptly.
Preserve business identity across every delivery.
Validate representative cases and ramp replay gradually.