Closed
Description
As of v4.3, @EnableBatchProcessing
auto-configures all infrastructure beans except a JobOperator
. So as a user, I still need to create a JobOperator
bean myself like:
@Bean
public JobOperator jobOperator(JobLauncher jobLauncher, JobRegistry jobRegistry,
JobExplorer jobExplorer, JobRepository jobRepository) {
SimpleJobOperator jobOperator = new SimpleJobOperator();
jobOperator.setJobExplorer(jobExplorer);
jobOperator.setJobLauncher(jobLauncher);
jobOperator.setJobRegistry(jobRegistry);
jobOperator.setJobRepository(jobRepository);
return jobOperator;
}
Since all collaborators of the JobOperator
(ie JobRepository
, JobLauncher
, JobRegistry
, JobExplorer
) are already created by @EnableBatchProcessing
, this bean could also be created automatically by the annotation with those dependencies already set on it.