Adding a composite microservice
Now, it’s time to tie things together by adding the composite service that will call the three core services!
The implementation of the composite services is divided into two parts: an integration component that handles the outgoing HTTP requests to the core services and the composite service implementation itself. The main reason for this division of responsibility is that it simplifies automated unit and integration testing; we can test the service implementation in isolation by replacing the integration component with a mock.
As we will see later on in this book, this division of responsibility will also make it easier to introduce a circuit breaker!
Before we look into the source code of the two components, we need to take a look at the API classes that the composite microservices will use and also learn about how runtime properties are used to hold address information for the core microservices.
The full implementation...