Я создал урезанную работу о том, как я использую ее для воспроизведения проблемы. Вот как я вызываю задания через основной класс:
Код: Выделить всё
public class Main implements CommandLineRunner {
private final JobLauncher jobLauncher;
private final Job jobConfig;
private int parallelism = 20;
public static void main(String[] args) {SpringApplication.run(Main.class, args);}
@Override
public void run(String... args) throws Exception {
File[] files = getFiles();
ExecutorService pool = Executors.newFixedThreadPool(parallelism);
List
Подробнее здесь: [url]https://stackoverflow.com/questions/79898718/parallel-spring-batch-jobs-mixing-up-data[/url]
Мобильная версия