O'Reilly logo

Practical Microservices by Umesh Ram Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example of service discovery pattern

There are many implementations available for this pattern, some of which are mentioned in the previous section, but for this particular example, we will use Netflix's Eureka. Spring has an in-built support for Netflix Eureka with Spring Boot (1.4.0+). With use of some annotation, we can create registry service and clients very easily. In this example, we will create one registry service and one client who will register itself while coming up. We will generate a sample code for Eureka server first from the Spring initializer or the Maven archetype. For this particular service, we will need some dependency to define spring-cloud-starter-eureka-server. Pom dependencies of eureka will be look like the following: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required