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:
/* THIS WON'T WORK
app.connectMicroservice({
transport: Transport.TCP,
options: {
host: 'localhost',
port: 3010
}
});
app.startAllMicroservicesAsync();
await app.listen(3010);
DON'T TRY THIS */
Thanks for the article, it is very helpful. I just wonder if you can use same port for app and service like the example above? I tried that settings, but got error that port 3000 is already taken. Do you know how to config it to the same port?
Oops... I made a mistake there, you cannot configure both things in the same port because, as you said, it's going to throw an error because the port has been already taken. I edited the comment. Sorry.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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 happening on port 4000 and 4010 .
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:Let me know if you have any more doubts :)
Hi,
Thanks for the article, it is very helpful. I just wonder if you can use same port for app and service like the example above? I tried that settings, but got error that port 3000 is already taken. Do you know how to config it to the same port?
Thanks!
Oops... I made a mistake there, you cannot configure both things in the same port because, as you said, it's going to throw an error because the port has been already taken. I edited the comment. Sorry.