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
clientserver publishes publishesmailer-send-exported-usersandtask-process-export-usersthat is beng handled inmailerandtaskservice. - Client Express - A very simple Express server that publishes event. The
client-expressis a simple server that demonstrates a way to publish and event and thetaskservice handles the published events. - Task service - responsible for heavy processing. The
taskservice is a hybrid NestJS application that listens for HTTP requests and make use of connected microservices. It publishesmailer-send-processed-dataevent and themailerservice handles the event. - Mailer service - responsible for sending out email messages. The
mailerservice 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
taskandmailer. - Then run the http servers either
clientorclient-express. Access the urlhttp://localhost:3000/sendorhttp://localhost:3005.