A batch Microservice is a type of short lived process that launches as the result of some trigger (typically a clock), or executed on demand.
The following Spring projects (along with Spring Boot of course) support building Batch Microservices:
Spring Batch provides reusable functions that are essential in processing large volumes of records, including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management. It also provides more advanced technical services and features that will enable extremely high-volume and high performance batch jobs through optimization and partitioning techniques. Simple as well as complex, high-volume batch jobs can leverage the framework in a highly scalable manner to process significant volumes of information.
See the Batch Domain for more details.
Spring Cloud Task supports the development of short-lived Microservices. In general, these perform simple tasks on demand and then terminate. Batch applications are just one example of where short lived processes can be helpful. Spring Cloud Task records lifecycle events of a given task. The lifecycle consists of a single task execution. This is a physical execution of a Spring Boot application configured to be a task (annotated with the @EnableTask annotation).
Spring Cloud Task requires a SQL database, for a TaskRepository, similar to the Spring Batch JobRepository. The following databases are supported:
Spring Cloud Task includes the following features:
@EnableTaskannotation to auto-configure a
See the code samples below.
Spring Cloud Data Flow (SCDF) is an orchestration layer on top of Spring Cloud Task (and Spring Cloud Stream) for batch processing. SCDF uses a Deployer abstraction to allow deployment of distributed Microservices on different runtime platforms, such as Pivotal Cloud Foundry. It also provides a DSL for defining tasks using registered applications as named resources, and a management UI.