In Part 1 of this series, we made an introduction to Spring Cloud with Kotlin. We discussed the Config Server, Discovery Server (Eureka), and created a microservice named data-service which is registered to Eureka and retrieves configuration from the onfig Server. At last, we had all three instances up and running.
In this part, we will show how to share data between microservices in Spring Cloud. As we said, there are many ways to achieve data sharing according to business needs. For example, if we want REST-based communication, we can use Feign Client; for asynchronous communication, we can use message brokers, etc. In this example, we will use Feign. We will add another microservice named user-service to contain data about users. We will try to retrieve information from its APIs by calling them from data-service, which we already built. To achieve this, we will use a Feign Client.
from DZone.com Feed https://ift.tt/2Q2YCvo
No comments:
Post a Comment