Create a proof-of-concept for a communication between services using NestJS framework.
This API showcase consists of the following parts:
- Client - A NestJS HTTP gateway to publishes events to microservices. The
client
server publishes publishesmailer-send-exported-users
andtask-process-export-users
that is beng handled inmailer
andtask
service. - Client Express - A very simple Express server that publishes event. The
client-express
is a simple server that demonstrates a way to publish and event and thetask
service handles the published events. - Task service - responsible for heavy processing. The
task
service is a hybrid NestJS application that listens for HTTP requests and make use of connected microservices. It publishesmailer-send-processed-data
event and themailer
service handles the event. - Mailer service - responsible for sending out email messages. The
mailer
service is a microservice that listens to events.
You will need redis installed on your server to support the queue and the transport.
We 4 have services overall.
Client
cd client && npm install && npm run start:dev
Client ExpressJS
cd client-express && npm install && npm run dev
Task
cd task && npm install && npm run start:dev
Mailer
cd mailer && npm install && npm run start:dev
- First, run the services
task
andmailer
. - Then run the http servers either
client
orclient-express
. Access the urlhttp://localhost:3000/send
orhttp://localhost:3005
.