Skip to content
Get started
Get started
DLQ Operations from the Queue Object
guide · queue

Dead jobs, from the producer side.

The Queue object carries the DLQ surface too, so the process that produces work can also configure and drain the pile of work that failed.

The dead letter queue collects jobs that failed permanently (retries exhausted, stalled too often, timed out). Configure how it behaves and act on its entries:

queue.setDlqConfig({
autoRetry: true, // Periodically re-queue DLQ entries
autoRetryInterval: 3600000, // Every hour
maxAutoRetries: 3,
maxAge: 604800000, // Drop entries older than 7 days
maxEntries: 10000,
});
// Synchronous snapshots (embedded mode)
const entries = queue.getDlq();
const stalledJobs = queue.getDlq({ reason: 'stalled' });
const stats = queue.getDlqStats(); // { total, byReason, pendingRetry, ... }
// Authoritative reads (embedded or TCP)
const remoteEntries = await queue.getDlqAsync({ reason: 'stalled' });
const remoteStats = await queue.getDlqStatsAsync();
// Act
queue.retryDlq(); // Retry all
queue.retryDlq('job-123'); // Retry one
queue.purgeDlq(); // Clear all
const retried = await queue.retryDlqByFilterAsync({ reason: 'stalled' });

DLQ configuration (setDlqConfig) is available in Bun, TypeScript, and Python; PHP, Go, Rust, and Elixir can set the same server policy through PUT /queues/:queue/dlq-config. Full metadata, stats, and server-side reason filters exist in the Bun package only; every SDK can use the HTTP metadata and stats endpoints. Automatic retries preserve their bounded retry chain and failure history across redelivery and SQLite-backed broker restarts.

See Dead Letter Queue for the full guide, and Stall Detection for setStallConfig(), which controls when unresponsive jobs are recovered.

Dead Letter QueueThe DLQ guide these operations belong to
DLQ OperationsFilter, retry selectively, check health, purge
DLQ ConfigurationBound the DLQ by age and by entry count
Queue APICreate a queue in embedded or TCP mode
Adding Jobsadd, addBulk, priorities, delays, durability
Deduplication and Idempotent Job AddsIdempotent adds, dedup keys, custom job ids
Querying JobsFetch jobs, states, counts and results
Queue Control and MaintenancePause, drain, obliterate, clean and repair
Progress, Job Logs and DependenciesProgress, per-job logs and dependencies
Queue Rate Limiting and Global ConcurrencyRate limits and global concurrency caps
Job Schedulers from the QueueNamed repeatable schedules from the queue
Workers, Stats and Metrics from the QueueRegistered workers, stats and metrics windows
Namespaces, Auto-Batching and Store-and-ForwardNamespaces, auto-batching, store-and-forward
JobOptions ReferenceEvery JobOptions field, with defaults