Menu

BullMQ in production: the retry, stalled-job and Redis connection mistakes that bite
📰

BullMQ in production: the retry, stalled-job and Redis connection mistakes that bite

DEV Community: typescript·quietkernel·2 days ago
#Mc5LduSF
#devtotypescript#devto#dev#bullmq#worker
Reading 0:00
15s threshold

BullMQ is easy to start with. You create a Queue , a Worker and a Redis connection, and jobs flow. Most of the problems show up later, under load, during a deploy or when Redis restarts.

This post covers common BullMQ mistakes, most of them called out in the official docs, why each one happens, and how to fix it. Everything here is checked against the BullMQ source (v6.4.2) and the official going-to-production guide . At the end there's a lint config that catches four of them before you ship.

1. Sharing one ioredis connection with maxRetriesPerRequest left at the default

This is the most common one. (In BullMQ 6, ioredis is an optional peer dependency, so install both: npm i bullmq ioredis .)

import { Queue , Worker } from ' bullmq ' ; import IORedis from ' ioredis ' ;

const connection = new IORedis ( process . env .…

Continue reading — create a free account

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