Introduction
- A high-performance job queue lib for Node.js.
- Use Redis to manage background jobs.
- To let the app to process tasks asynchronously instead of blocking the main app thread.
Client
↓
API Server (Producer)
↓
BullMQ Queue
↓
Redis Server
↓
Worker Server
- processes job in background
↓
Process Job
Scenarios
- Sending emails 📧
- Processing uploaded images 🖼️
- Generating reports 📊
- Calling slow APIs 🌐
- AI processing 🤖
BullMQ Job Lifecycle
waiting → active → completed
↓
failed
| State |
Meaning |
| waiting |
Job is in queue |
| active |
Worker is processing the job |
| completed |
Job finished successfully |
| failed |
Job failed during processing |