In this section, we will learn how to connect microservice instances to a Netflix Eureka server. We will learn both how microservices instances register themselves to the Eureka server during their startup and how clients can use the Eureka server to find microservice instances it wants to call.
To be able to register a microservice instance in the Eureka server, we need to do the following:
- Add a dependency to spring-cloud-starter-netflix-eureka-client in the build file, build.gradle:
implementation('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')
- When running tests on a single microservice, we don't want to depend on having the Eureka server up and running. Therefore, we will disable the use of Netflix Eureka in all Spring Boot tests, that is, JUnit tests annotated...