Home United States USA — software Microservices Communication: Eureka Client Microservices Communication: Eureka Client

Microservices Communication: Eureka Client Microservices Communication: Eureka Client

212
0
SHARE

Service discovery is great for microservice communication, so here’s how you can do it in Java using Spring Boot and Eureka, including a Eureka primer.
In my previous Java microservices tutorial example, I created a Eureka Server. In this tutorial, I will show you how microservice communication happens. In this tutorial, I will create a Eureka client that communicates with a Eureka server — a microservices service registry.
If you haven’t gone through the previous articles, please click here .
Before diving into the code, let me tell you more about the about Eureka’s client/server communication.
We will make the EmployeeSearchService a Eureka client. To do that, first, we need to add the discovery module for Spring Boot in the Maven pom.xml
Now add the @EnableDiscoveryClient annotation on top of EmployeeSerachServiceApplication.java
After that, run the Eureka server first, then EmployeeSearchApplication. You will see that the Employee Search application is registered in the Eureka server with the service id EmployeeSearchService.

Continue reading...