Service registration

I am able to register a service with HTTP Api catalog which is not there in reality and it gets register. How can I map a service to actual service? Am I missing a concept here? Thanks

Hi @rakshitcgupta,

Could you clarify what you mean by registering a service which is not there in reality?

Also, what do you expect mapping a service to an actual service would be like?



this means… consul services register “some random name”
and this command gets executed
Basically the service doesnot exist

I see. Yes, you can register services with any name in Consul, even if the service does not exist.

One way to tie a registration to an actual service is by also registering a health check for the service.

When you issue a DNS query for that service, it will only return the address if its checks are passing (and a service that does not exist should not be able to pass a health check).

The workflow to keep services and Consul in sync is primarily up to the user.

Users often opt to register services with Consul during the service deployment. For example, if a new instance of an api service is being deployed, a step in that deployment process would be to register the service with its local Consul agent.