Creating a microservice (the Producer)

We will discuss and create a microservice, account-service, as we have seen in the preceding diagram. This microservice registers itself with the registry service or discovery service with its logical service name as account-service.

First, we need to add the required Maven dependencies. Again, use the spring-cloud release train to manage versions:

<properties> ... <spring-cloud.version>Finchley.M8</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> ...

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.