How to Fan Out Shipment Updates Reliably — Queue Retries and Live Delivery
Use a queue-based Node.js worker for a daily scheduled email report, then hand each accepted shipment update to a live-delivery channel with the same idempotency key. That boundary keeps a temporary subscriber disconnect from deleting durable work.
Before: cron -> generate report -> notify everyone -> one timeout hides several failures.
After: cron -> queue -> idempotent worker -> acknowledgement -> live publish.
The daily report is the durable unit. The realtime message is a delivery attempt. Those are different jobs.
What should the scheduler own?
A scheduler should start work, not perform all of it. A daily report can cover many shipment updates, so the trigger should enqueue a small job and return. The worker consumes that job, generates the report, and publishes the notification.…