How to do it...

Let's implement a non-blocking batch process by following these steps:

  1. Create a Spring Boot 2.0 project, ch11-batch-async, that has the same starter POM dependencies with the same MySQL connection pool support and Spring OXM module.
  2. Create a bootstrap class that enables batch processing and task scheduling:
@EnableBatchProcessing 
@SpringBootApplication 
@EnableScheduling 
public class AsyncBatchBootApplication { 
    
 public static void main(String[] args) throws Exception { 
     SpringApplication.run(AsyncBatchBootApplication.class, 
 args); 
 } 
} 
  1. In its src\main/\resources directory, create application.properties that contain the same configuration as the one in ch11-batch-sync. Just modify some server-related configurations.
  2. Copy

Get Spring 5.0 Cookbook 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.