Batch and Message-Driven Processes

The microservices in the previous chapter gave us a clear solution on how to decompose huge applications into independent, scalable, and manageable components that somehow provide the procedure on how to practically apply a loosely coupled architecture design in software development. In applying this loose-coupling approach, the huge hrs application built in the previous chapters is now composed of three service boxes, each having its own domain-related operations. Some recipes consumed RESTful services from any of these microservices using the WebClient or Spring Cloud modules, and applied logging, data retrieval, and data persistence to some web services. Other than exposing services through REST, in this chapter, we will explore and scrutinize more features of Spring 5, such as interprocess communication among microservices and within a microservice to achieve a scalable and robust Spring 5 application.

The focus will now be on creating synchronous, asynchronous, and reactive batch processes and message-driven communication that are supported by Spring 5. The inclusion of the broker software called RabbitMQ will be showcased to help the implementation of Advanced Message Queuing Protocol (AMQP), which is needed for both direct exchange and message-based communication among microservices. Also, by using the RabbitMQ server, Spring Cloud Stream will be used to provide a solution for sending the Object data and reactive stream from one microservice to another.

On the other hand, the creation of microservices that execute batch process continuously and periodically through Spring Batch and Spring Cloud Task will also be part of the following recipes. In general, the objective is to venture into Spring 5 modules that support the core concepts of building batch processing and message-driven transactions in a microservice, which are essential in many enterprise solutions.

In this chapter, we will cover the following recipes:

  • Building synchronous batch processes
  • Implementing batch processes with a database
  • Constructing asynchronous batch processes
  • Building synchronous interprocess communication using AMQP
  • Creating asynchronous send-receive communication
  • Creating an event-driven asynchronous communication using AMQP
  • Creating stream communication with Spring Cloud Stream
  • Implementing batch processes using Spring Cloud Task
..................Content has been hidden....................

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