Service Discovery is one of the key patterns of a microservice-based architecture. Spring Cloud provides Service Discovery functionality with Netflix OSS's Eureka. Eureka is the Cloud Service Discovery Server and Client. In the previous section, we saw how to implement the Netflix Service Discovery server. Here, I am going to implement the Netflix Service Discovery client.
To implement Eureka Client in your project, include the Spring Cloud Starter with the org.springframework.cloud
group and the id spring-cloud-starter-netflix-eureka-client
artifact. Also include spring-boot-starter-web
in pom.xml
and implement a REST controller to create a simple REST service to be registered with the Eureka Discovery Server. Let's see the following Maven configuration file:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>...