All of the microservices implemented here are designed for long-lived communication. There are service boxes that are written just to trigger auditing, transfer files through FTP, convert Excel sheets to PDF, and complete file compression and decompression. Spring Cloud Task is part of the Spring Cloud project that offers implementation for short-lived microservices, which will be showcased by this last recipe.
This application is a simple microservice template that will guide us on how to build and execute tasks that run only within a short period of time.
Let's implement a simple event using Spring Cloud Task:
- Create a Spring Boot 2.0 project,
ch11-batch-task
, that contains the core starter POM such as webflux, actuator, and the Tomcat server for Spring Boot 2.0, with the addition of the needed Spring Cloud dependent management configuration, which is Spring Cloud Finchley. - Add the following Spring Cloud Task...