For a healthtech renewal reminder, this Node.js setup creates a message queue and publishes a background task that must wait until a business deadline, survive a worker restart, and remain explainable when an operator has to recover it. My default design is a durable job record plus a queue message carrying an idempotency key. The worker claims the message, checks the deadline again, sends once, and acknowledges only after the side effect succeeds.
That last check matters. A queue delay is an implementation detail. The deadline is the business rule.
What should the queue remember?
Use this mental model: the database is the calendar; the queue is the work handoff. A producer writes the renewal job with its due time, then publishes a small message that points to that job. A worker consumes the message and reads the current state before acting.…