Redis Queue (BullMQ)
Build reliable job queues and background workers with BullMQ, powered by Redis for distributed processing.
Overview
The library uses Redis Streams and Lua scripts for atomic operations, providing strong guarantees about job processing order and completion. Workers can process jobs concurrently with configurable concurrency limits, and failed jobs are automatically retried with exponential backoff. The event system provides real-time visibility into queue state changes, job progress, and worker health.
BullMQ is the successor to Bull and provides significant improvements including support for flows (multi-step job pipelines), sandboxed processors for isolated job execution, and global events. The library includes a dashboard UI (Bull Board) for monitoring queues, and integrates with OpenTelemetry for distributed tracing. It is widely used for email sending, image processing, data pipelines, and webhook delivery.
Who Is This For?
- Process email sending jobs in the background
- Build image/video processing pipelines with worker pools
- Schedule recurring tasks like report generation
- Implement webhook delivery with retry logic
Installation
npm install bullmq Configuration
import { Queue, Worker } from "bullmq"
const emailQueue = new Queue("emails", {
connection: { host: "localhost", port: 6379 },
})
// Add a job
await emailQueue.add("welcome-email", {
to: "user@example.com",
subject: "Welcome!",
})
// Process jobs
const worker = new Worker("emails", async (job) => {
await sendEmail(job.data)
}, { connection: { host: "localhost", port: 6379 }, concurrency: 5 }) Explore AI Tools
Discover the best AI tools that complement your skills
Read AI & Design Articles
Tips and trends in the world of design and AI
Related Servers
Sentry Error Tracking
Monitor errors and performance issues in production with Sentry. AI agents can triage alerts and suggest fixes based on stack traces.
PostHog Product Analytics
Track product usage, manage feature flags, and analyze user behavior with PostHog, an open-source product analytics platform.
Database Query Builder
Generate and optimize SQL queries with AI assistance. Build complex queries, analyze execution plans, and improve database performance.