Spring Cloud Task

Spring Cloud Data Flow can also be used to create and schedule batch applications. For the last decade, Spring Batch has been the framework of choice to develop batch applications. Spring Cloud Task extends this and enables execution of batch programs on the Cloud.

Let's use Spring Initializr (https://start.spring.io) to set up the application. Provide the details listed here and click on Generate Project:

  • Group: com.mastering.spring.cloud.data.flow
  • Artifact: simple-logging-task
  • Dependencies: Cloud Task

Update the SimpleLoggingTaskApplication class with the following code:

@SpringBootApplication@EnableTaskpublic class SimpleLoggingTaskApplication {@Beanpublic CommandLineRunner commandLineRunner() { return strings -> System.out.println( ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.