Iii iii-dead-letter-queues
install
source · Clone the upstream repo
git clone https://github.com/iii-hq/iii
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/iii-hq/iii "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/iii-dead-letter-queues" ~/.claude/skills/iii-hq-iii-iii-dead-letter-queues && rm -rf "$T"
manifest:
skills/iii-dead-letter-queues/SKILL.mdsource content
Dead Letter Queues
Comparable to: SQS DLQ, RabbitMQ dead-letter exchanges
Key Concepts
Use the concepts below when they fit the task. Not every queue failure needs manual DLQ intervention.
- Jobs move to a DLQ after exhausting
with exponential backoff (max_retries
)backoff_ms * 2^attempt - Each DLQ entry preserves the original payload, last error, timestamp, and job metadata
- Redrive via the built-in
function or theiii::queue::redrive
CLI commandiii trigger - Redriving resets attempt counters to zero, giving jobs a fresh retry cycle
- Always investigate and deploy fixes before redriving — blindly redriving repeats failures
- DLQ support available on Builtin and RabbitMQ adapters
Architecture
A queue consumer fails processing a job. The engine retries with exponential backoff up to
max_retries. Once exhausted, the message moves to the DLQ. An operator inspects the failure, deploys a fix, then redrives the DLQ to replay all failed jobs.
iii Primitives Used
| Primitive | Purpose |
|---|---|
| Redrive all DLQ jobs for a named queue |
| Check queue and DLQ status |
| CLI redrive command (part of the engine binary) |
| CLI flag to set trigger timeout (default 30s) |
in iii-config.yaml | Configure and |
Reference Implementation
See ../references/dead-letter-queues.js for the full working example — inspecting DLQ status,
Also available in Python: ../references/dead-letter-queues.py
Also available in Rust: ../references/dead-letter-queues.rs redriving failed jobs via SDK and CLI, and configuring retry behavior.
Common Patterns
Code using this pattern commonly includes, when relevant:
— redrive via SDKawait iii.trigger({ function_id: 'iii::queue::redrive', payload: { queue: 'payment' } })
— redrive via CLIiii trigger --function-id='iii::queue::redrive' --payload='{"queue": "payment"}'
— with custom timeoutiii trigger --function-id='iii::queue::redrive' --payload='{"queue": "payment"}' --timeout-ms=60000- Redrive returns
indicating count of replayed jobs{ queue: 'payment', redriven: 12 } - Inspect in RabbitMQ UI at
, findhttp://localhost:15672iii.__fn_queue::{name}::dlq.queue - Best practice: investigate failures, deploy fix, then redrive
- Monitor DLQ depth as an operational alert signal
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Set
andmax_retries
inbackoff_ms
based on your failure tolerancequeue_configs - Build an admin endpoint that calls
for operational controliii::queue::redrive - Use
to check DLQ depth before and after redrivingiii::queue::status - For dev/test, use lower retry counts to surface failures faster
- In production with RabbitMQ, use the management UI for detailed message inspection
- Consider building an alerting function that triggers on DLQ depth thresholds
Engine Configuration
Queue
max_retries and backoff_ms are set per queue in iii-config.yaml under queue_configs. See ../references/iii-config.yaml for the full annotated config reference.
Pattern Boundaries
- For queue processing patterns (enqueue, concurrency, FIFO), prefer
.iii-queue-processing - For queue configuration (retries, backoff, adapters), prefer
.iii-engine-config - For function registration and triggers, prefer
.iii-functions-and-triggers - Stay with
when the primary problem is inspecting or redriving failed jobs.iii-dead-letter-queues
When to Use
- Use this skill when the task is primarily about
in the iii engine.iii-dead-letter-queues - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.