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

Revisit the mechanism of job registration #4547

Closed
fmbenhassine opened this issue Feb 6, 2024 · 0 comments
Closed

Revisit the mechanism of job registration #4547

fmbenhassine opened this issue Feb 6, 2024 · 0 comments

Comments

@fmbenhassine
Copy link
Contributor

The mechanism of using a BeanPostProcessor to populate the job registry is problematic as it introduces a dependency (the JobRegistry bean) in the JobRegistryBeanPostProcessor. Having dependencies in BPPs is not recommended and might cause issues like #4519 and #4489. Here is an excerpt from the SF docs:

If you have beans wired into your BeanPostProcessor by using autowiring or @Resource (which may
fall back to autowiring), Spring might access unexpected beans when searching for type-matching
dependency candidates and, therefore, make them ineligible for auto-proxying or other kinds of
bean post-processing

It turns out this has always been problematic in Spring Batch, and only made visible after the log level change in SF #24092. This issue is to deprecate the JobRegistryBeanPostProcessor in favor of a SmartInitializingSingleton (like suggested in #4521) or another mechanism that is not prone to trigger early initializations of beans.

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