The Microservices

After the success of service-oriented architecture (SOA), the term microservice has been in the enterprise software development for quite a while now and is popular and useful to many experts in building up decomposed services and domain models in many huge applications. Either to be used for small or huge enterprise software development, the purpose of microservice architecture is to break down monolithic software prototypes into independent and granulized service boxes, each having an independent set of objectives and tasks that can be pulled to decorate a needed requirement. Unlike in distributed architecture where each submodule does not necessarily interact with the other at runtime, in microservice design there is always a gray area where these service boxes communicate depending on the modes and approaches of inter-process communication.

But this chapter will not discuss the theoretical concept of microservices per se, rather, it will prove that Spring 5 supports and helps build microservices, either with typical RESTful web services for synchronous transactions or with @Async, Callable<T> and DeferredResult<T> tasks for asynchronous services. Moreover, one of the main highlights also is the newest reactive microservice architecture made up of the Flux<T>, Mono<T> and Publisher<T> data streams generated from Spring Data JPA repositories. Based on the core concepts of a reactive and functional web framework of Chapter 9, Spring Boot 2.0, some recipes in this chapter will emphasize building, organizing, and managing reactive RESTful services that will comprise these microservices from different domain responsibilities. Likewise, constructing the client-side application that will consume all the exposed endpoints will also be included.

On the other hand, this chapter will also be about interaction among microservices and how the libraries of Spring Cloud work with Spring Boot 2.0.0.M2 in managing the design of these microservices.

In this chapter you will learn:

  • Exposing RESTful services in Spring 5
  • Using the actuator REST endpoints
  • Building a client-side application with RestTemplate, AsyncRestTemplate, and WebClient
  • Configuring the Eureka server for service registration
  • Implementing the Eureka service discovery and client-side load balancing
  • Applying resiliency to client application
  • Consuming endpoints using a declarative method
  • Using Docker for deployment
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.71.94