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 JobRegistryBeanPostProcessor with EnableBatchProcessing and DefaultBatchConfiguration #4245

Closed
fmbenhassine opened this issue Nov 23, 2022 · 2 comments

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Nov 23, 2022

As of v4.3, @EnableBatchProcessing auto-configures a JobRegistry in the application context. So as a user, I still need to create a JobRegistryBeanPostProcessor bean myself to populate the registry:

@Bean
public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(JobRegistry jobRegistry) {
    JobRegistryBeanPostProcessor postProcessor = new JobRegistryBeanPostProcessor();
    postProcessor.setJobRegistry(jobRegistry);
    return postProcessor;
}

Since the JobRegistry is already created by @EnableBatchProcessing, this bean post processor could also be created by the annotation with the registry already set on it.

This also should apply to the programmatic way of configuration through DefaultBatchConfiguration introduced in v5.


References:

@fmbenhassine
Copy link
Contributor Author

Resolved in 66e0b9a.

@fmbenhassine
Copy link
Contributor Author

fmbenhassine commented Nov 23, 2022

Re-opening this issue as it introduced a (late) unexpected breaking change in Boot for v3.0.

Will be revisited in Batch 5.1 / Boot 3.2.

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