BullMQ with BullBoard
A queueing solution with a dashboard to visualize, monitor and retry.
bull-board
ncontiero/fastify-bullmq
Just deployed
Redis
bitnami/redis:7.4.3
Just deployed
/bitnami
bullmq-worker
ncontiero/fastify-bullmq
Just deployed
✨ Features
- Queueing system with BullMQ and Redis;
- Dashboard built with bull-board and Fastify;
- Run services through pm2.
GitHub: https://github.com/ncontiero/fastify-bullmq
Explanations
This application uses BullMQ, a Redis-based queueing system, and Bull-Board, a dashboard to monitor and manage these queues, served by a Fastify server. Both services are built using Rslib and managed by PM2.
There are three distinct ways to start the services:
- Unified Execution: To start both services simultaneously, use the command
pnpm start
. This is the simplest option for local development. - Separate Execution: To start the worker and Fastify server individually, use the commands
pnpm start:worker
andpnpm start:server
, respectively. This approach offers greater control and is used in this template, but can be easily adapted to your needs. - Direct Node.js Execution: For simple projects that do not require PM2 features, direct execution with Node.js can result in lower resource consumption. Use
node ./dist/worker.js
for the worker andnode ./dist/server.js
for the Fastify server.
PM2 also supports Bun. If desired, you can replace the project's package manager with Bun and execute the TypeScript files directly (Bun has native support for TypeScript), eliminating the need for a build. However, be aware that Bun is not fully compatible with Node.js, which may result in execution problems.
Scalability (PM2): Both services support horizontal scaling through the WORKER_INSTANCES
and SERVER_INSTANCES
environment variables. Set these variables to the desired number of instances to increase the processing capacity of the worker and server, respectively. These variables will only take effect if PM2 is being used.
Template Content