loading...

re: Building authentication for microservices using NestJS VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Firstly thank you for this its really helpful I just have few doubt , auth is running at 3000 and user is running at 3010 then what is happenin...
 

Hi! Thank you for reading. The difference is just that the "message" interface is listening on TCP port 4000 and 4010 and the standard HTTP interface is listening on port 3000 and 3010.

If you configure a ClientProxy with transport TCP and port 3000, those messages are not going to arrive to the auth microservice, since it is waiting for messages on port 4000.

Being that said, you can use the same port for por listening HTTP requests and messages, so you could configure a microservice as:

app.connectMicroservice({
transport: Transport.TCP,
  options: {
    host: 'localhost',
    port: 3010
  }
});

app.startAllMicroservicesAsync();
await app.listen(3010);

Let me know if you have any more doubts :)

Code of Conduct Report abuse