#microservicr TCP connection

7 messages · Page 1 of 1 (latest)

modest ermine
#

I have been using Nest js with monorepo micro service architecture.
I have a total of 6 different services and i need to call a service from another service so that's what TCP connection.

In nest js when i configure using ClientsModule I need to pass host.We have everything setup in kubernates.So when i need to pass host in Clientsmodule.register what should be it?

service-name.namespace?
As when i pass this it shows me connection refused.

Thanks in advance.

nocturne pilot
#

Usually you also need the port. So, service-name.namespace:port. You only need the namespace, if the pod with the application is outside of your namespace, which would be bad practice, to do.

Your service should also be set up properly with both a port and target port and of course, your application should be listening on 0.0.0.0:port. port being the port the application should run on and the target-port of the service.

#

Also, why are you starting with microservices?

modest ermine
#

Im already adding port in port key of options object

#

So is host required?

nocturne pilot
#

What do you mean? Is host required where?

#

And, above when I meant "service", I meant the k8s service. Have you set one up?