NestJS Micro-services 101 Part 1 - Try to communicate btw two services
Perm Chao
Posted on October 1, 2022
I try to learn NestJS Framework to make micro-services
Objective in Part 1
send simple message from one service to another service
// Project 1 api-gateway
nest new api-gateway
// Project ที่ 2 user-service
nest new user
User Request (http://localhost:3000) -> API Gateway -> User
Difference btw bootstrap in api-gateway
and user
api-gateway service will know user service by register in api-gateway module
so you can declare user service proxy in constructor to send data into it, by
hello
is event pattern
user service controller will receive event pattern name hello
by use EventPattern
decorator
Full code https://github.com/mossnana/nestjs/tree/microservices
💖 💪 🙅 🚩
Perm Chao
Posted on October 1, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
microservices NestJS Micro-services 101 Part 1 - Try to communicate btw two services
October 1, 2022