Goal
Set up a queue consumer that retries on transient failures (e.g. an external endpoint being down) and automatically routes jobs to a dead letter queue (DLQ) when all retries are exhausted.Steps
1. Register the external endpoint as an HTTP-invoked function
Register the payment API as an HTTP-invoked function. The engine makes the HTTP call — when the endpoint is down or returns a non-2xx status, the engine marks the invocation as failed. When this function is invoked via a named queue, the queue worker retries it based on the queue’s config.- Node / TypeScript
- Python
- Rust
payment-processor.ts
2. Define a named queue with retry configuration
Declare the queue iniii-config.yaml with the retry and backoff settings. When the payment
endpoint fails, the engine retries with exponential backoff until max_retries is exhausted — then
the job moves to the DLQ. Enqueue work to this function by calling trigger() with
TriggerAction.Enqueue from wherever the order is created.
iii-config.yaml
- Node / TypeScript
- Python
- Rust
order-handler.ts
| Attempt | Delay before retry |
|---|---|
| 1 | 2 s |
| 2 | 4 s |
| 3 | 8 s |
| 4 | 16 s |
| 5 | — moved to DLQ |
3. What happens when a job lands in the DLQ
When the payment endpoint is down and all 5 retries exhaust, the engine:- Removes the job from the active queue
- Stores it in the DLQ with the original payload, the last error, and a
failed_attimestamp - Logs a warning:
4. Queue configuration reference
| Field | Type | Default | Description |
|---|---|---|---|
max_retries | u32 | 3 | Maximum delivery attempts before moving to DLQ |
backoff_ms | u64 | 1000 | Base delay in ms between retries (exponential: backoff_ms × 2^(attempt − 1)) |
concurrency | u32 | 10 | Max concurrent jobs for this queue |
type | string | "standard" | Queue mode: "standard" (concurrent) or "fifo" (ordered) |
Result
Failed jobs retry automatically with exponential backoff. After all retries exhaust, the job moves to the DLQ where it is preserved with its full payload and error context. The engine continues processing new messages in the queue without interruption.DLQ is fully supported by the Builtin and RabbitMQ queue adapters. The Redis adapter does not support DLQ operations.