Answer the question
In order to leave comments, you need to log in
How to make a Gateway (single gateway) RabbitMQ for microservices in NestJS?
Greetings.
Previously, I used bare NodeJS and connected microservices through a single gateway gateway using RabbitMQ.
Example:
Gateway:
const gateway = new Gateway({
microservices: [
'user'
],
rabbit: {
url: 'amqp://localhost:5672',
}
})
// И ДЕЛЕГИРОВАЛ ЗАПРОСЫ В МИКРОСЕРВИС:
gateway.post(['/register', '/login'], async (req, res) => {
await res.delegate('user')
})
const app = new MicroMQ({
name: 'user',
rabbit: {
url: process.env.RABBIT_URL,
},
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question