Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-configure SimpleJobOperator with EnableBatchProcessing and DefaultBatchConfiguration #3941

Closed
fmbenhassine opened this issue Jun 16, 2021 · 0 comments

Comments

@fmbenhassine
Copy link
Contributor

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.

@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Jun 16, 2021
@fmbenhassine fmbenhassine modified the milestones: 5.0.0, 5.1.0 May 4, 2022
@fmbenhassine fmbenhassine changed the title Auto-configure SimpleJobOperator with EnableBatchProcessing Auto-configure SimpleJobOperator with EnableBatchProcessing and DefaultBatchConfiguration Nov 23, 2022
@fmbenhassine fmbenhassine modified the milestones: 5.1.0, 5.0.0 Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant