In Server VRT,
- What do we mean by Discovery API?
- How can we configure discovery api at server level?
- What are the necessary properties which must be provided to make it operational?
In Server VRT,
Discovery API is a service that is used to store the address of services like dbes, igw, security, DMS, and sync engine. when the end user requests some resource through the app response will be returned by discovery to api gateway.
we can configure it in vahana from the environment and then click on VRT Then we have to put VRT IP which is the IP of api gateway which will internally call discovery API. As discovery API is not exposed directly to the end user.
Here question is confusing, There is nothing like Discovery API microservice.
If you are talking about, Service Discovery or Service Registry is one of the microservice design pattern.
In Spring Cloud family Netflix Eureka service registry is called as Discovery Server or Service Discovery or Service Registry.
What is Service Discovery?
A service registry enables client-side load-balancing and decouples service providers from consumers without the need for DNS. It is a dedicated server that is responsible to maintain the registry of all the Microservice that has been deployed and removed.
How we can configure Service Discovery?
We can download spring boot project from here as below:
Add @EnableEurekaServer in mail class
@EnableEurekaServer
@SpringBootApplication
public class ServiceRegistrationAndDiscoveryServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceRegistrationAndDiscoveryServiceApplication.class, args);
}
}
Necessary properties which must be provided to make it operational
server:
port: ${PORT:8761} # Indicate the default PORT where this service will be started
eureka:
client:
registerWithEureka: false #telling the server not to register himself in the service registry
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0 #wait time for subsequent sync
Now we use consul service discovery in latest versions.
Is there any specific reason or benefit to using Consul instead of Eureka Discovery?