Service discovery
Service Discovery Servers allow us to dynamically register the instances of our microservices. Having a dynamic list of instances could be used either by applications or other microservices when they need to perform a request. They help us to dynamically manage when instances are starting or stopping to give an accurate view on the scaling of our microservices. Finally, they provide a mechanism to disconnect instances where they are not available using a Heart-beat mechanism.
Spring Cloud provides a vendor-independent approach to Service Discovery. We can use a range of different implementations, such as Hashicorp Consul, Netflix Eureka, or Apache Zookeeper. In this section, we will learn how easily we can integrate with Eureka using Spring Cloud.
Creating a Service Discovery Server
We can use Spring Initializr again to create our Discovery Server by visiting https://start.spring.io/.
We have chosen to create a Maven Project
using Kotlin and Spring Boot
2.0.0 M7
, we chose the...