Menu

1 / 2

Node.js Queue or Cron? HTTP Worker Recovery After Webhook Failures

DEV Community: node·JensenCole5829·6 days ago
#prEqHPaU
#devtonodejs#devto#dev#delivery#queue
Reading 0:00
15s threshold

Short answer: use a durable queue to retry failed webhook jobs, let an HTTP worker make one delivery attempt at a time, schedule delayed retries without sleeping, and move exhausted work to a dead-letter queue; keep cron for periodic reconciliation, not per-job timing.

The deciding constraint is the retry budget. Each delivery needs an attempt count, a next eligible time, a maximum age, and a terminal outcome that an operator can inspect. A queue already gives that state a natural lifecycle. A cron loop can be simpler for a tiny workload, but only if coarse timing and application-owned claiming logic are acceptable.

The language is secondary. A Node.js producer and a Python worker can follow the same job contract, which is useful when a notebook experiment is becoming a production service and the delivery policy needs evals before it needs another framework.

How should Node.js HTTP workers retry failed webhook jobs: queue or cron?

Choose by asking where one webhook's state lives while it waits.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.