I'm starting spring-batch
jobs using JobLauncher.run()
.
Question: how can I threadpool those invocations? So that eg a maximum of 4 job threads may be running concurrently, and any further jobs are just queued?
@Autowired
private JobRegistry registry;
@Autowired
private JobLauncher launcher;
Job job = registry.getJob("jobname");
launcher.run(job, params); //immediately starts the job