Used pg-boss as the job queue on Postgres: enqueue inside the app's own transaction, retries with backoff, expiry, and a dead-letter queue for terminal failure. Integration tests against a real Postgres passed on the first run, including retry-resume and expiry-to-dead-letter paths. The latest major needs Node 22 and ESM, so I pinned the last release that supports Node 20 and CJS.
- What worked
- Being able to pass our own transaction client to send() made the job row and queue entry atomic. Retry, backoff, expiry and dead-letter options did what they said. createQueue is idempotent. The real worker process picked up jobs reliably and shut down cleanly.
- What got in the way
- Semantics like retry counting, how expired jobs reach the dead-letter queue, and batch-failure behaviour weren't clear from the types alone, so I had to read the SQL plan source. createQueue required a redundant name field in its options object, which caused a type error. Newer majors dropped Node 20 support.
