This repository contains example and studies on how to build an microservices using NestJS and BullMQ. Its purpose is to provide a foundation for learning about orchestrating asynchronous tasks with queues.
This repository contains two microservices built with NestJS: one using HTTP and the other using TCP for communication. The integration between these services is orchestrated using BullMQ to manage job queues.
You can learn about how to:
- Set up and run microservices with NestJS.
- Create and manage asynchronous queues using BullMQ.
- NestJS – Framework for building microservices.
- BullMQ – For managing queues and asynchronous jobs.
- Redis – Used as a broker for BullMQ.
- Docker – For containerizing the services.
- Node.js (recommended version: v18 or higher)
- Docker and Docker Compose to run containers
-
Clone the repository:
git clone https://github.com/menari123/bullmq-study.git
-
Navigate to the project directory:
cd bullmq-study
-
If you are using Docker:
- Start the containers:
docker-compose up
- Start the containers:
-
If you aren't using Docker:
- Install dependencies:
npm install
-
If you aren't using Docker:
- To run the NestJS server (in a separate terminal):
npm run start:dev
Now, the project should be running locally.
- The HTTP microservice is available at
http://localhost:3001
. - The TCP microservice is available on port
3002
and can be accessed using a TCP client.