Background Jobs in NestJS with BullMQ, for Spring Developers: Crashed, Nothing Sent

1 October 2026 nestjstypescriptnodejsjavaspring-bootredis
PDF The design sheet The full architecture and the verified references. Free, no email.
Thumbnail for Background Jobs in NestJS with BullMQ, for Spring Developers: Crashed, Nothing Sent 4:39
Watch on YouTube, or read on below.
Run this yourself → Clone the repo, docker compose up, and watch it happen

Five receipt emails handed to the background so the request could answer fast. It answered in 12 milliseconds. One second later the process was killed and restarted: zero receipts sent, on Spring Boot with @Async and on NestJS with a promise nobody awaited. Measured on 1 October 2026 with real processes and SIGKILL.

A queue keeps what was waiting

With the receipts in a BullMQ queue, four were sent within twelve seconds of the restart. The fifth, running when the process died, came back 62 seconds later, once its lock expired and it was treated as stalled: this setup’s defaults, not a fixed recovery time.

At least once

A job that recorded a charge and died before completing ran again: charged twice. The queue did what it promises; the side effect has to be idempotent.

Defaults and the gap

BullMQ’s default is one attempt and one job at a time; set attempts, backoff and concurrency. And a payment committed to Postgres before a crash never got its receipt job: a durable queue protects work after it enters the queue, not the write that puts it there. That is what an outbox is for.

The full code for every measurement is in the repository, and the free design sheet above has the checklist on one page.


Watch next

New videos land on Code with Sam - subscribe there if this was useful.

Get the interview pack

A free, practical pack for engineers preparing for senior backend interviews - the questions that actually get asked, and how to answer them like someone who has done the work.

New articles and videos when they land. No spam, and one click to leave.