Menu

Node.js Shipment Reminder Queue Retries (Idempotency Before Subscriber Fan-Out)
📰

Node.js Shipment Reminder Queue Retries (Idempotency Before Subscriber Fan-Out)

DEV Community: node·LyraP22·2 days ago
#xCoOgY0a
#devtonodejs#devto#dev#queue#reminder
Reading 0:00
15s threshold

Short answer: if a shipment reminder is sent twice, assume the queue can deliver twice and make the Node.js sender idempotent with a durable key derived from user_id + reminder_id + scheduled_at ; acknowledge the message only after that result is safely recorded.

For a game studio shipping collector editions, one warehouse update can fan out to thousands of subscribers. The tempting implementation is consume, send, then ack. It looks correct on the happy path. It isn't enough once a worker loses its lease, restarts after sending, or retries a delivery whose acknowledgement was never recorded. The same message can legitimately return.

This is an effective-cost problem more than a queue-price problem. Duplicate SMS or email sends spend money downstream, trigger support tickets, and erode trust. The queue bill is only one line.

Replay matrix: the result before the mechanism

Standard queue delivery is at-least-once.…

Continue reading — create a free account

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