Menu

Shipment Fan-Out: Node.js Background Queue Workers, Ack/Nack, Dead Letters, Idempotency
📰

Shipment Fan-Out: Node.js Background Queue Workers, Ack/Nack, Dead Letters, Idempotency

DEV Community: node·grahamprice3746·about 2 hours ago
#GjmDvsLB
#devtonodejs#devto#dev#delivery#retry
Reading 0:00
15s threshold

Short answer: to create a Node.js background job queue for shipment updates, give each subscriber a queue delivery, acknowledge only after the update is durably accepted, retry only transient failures, and make the worker idempotent because fan-out delivery is at-least-once in the failure cases that matter.

That decision is more important than the queue client. A shipment update may need to reach a carrier portal, a warehouse dashboard, a customer notification service, and an internal audit stream. Those destinations do not share latency, availability, or retry behavior. Treating the fan-out as one large request makes the slowest subscriber define the whole operation; treating it as independent jobs gives each delivery its own attempt history and audit trail.

The ledger-minded rule is simple: a message is not complete because a worker received it, and it is not complete because an HTTP call returned. It is complete when the business result and the idempotency record have crossed the same durable boundary.…

Continue reading — create a free account

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