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

Use '@EnableBatchProcessing' carefully on Spring Boot3. #4605

Open
kang-seongbeom opened this issue May 29, 2024 · 2 comments
Open

Use '@EnableBatchProcessing' carefully on Spring Boot3. #4605

kang-seongbeom opened this issue May 29, 2024 · 2 comments
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter

Comments

@kang-seongbeom
Copy link

When using '@EnableBatchProcessing' in Spring Boot3, default settings are initialized. Therefore, batch operation may not work.

@kang-seongbeom kang-seongbeom added the status: waiting-for-triage Issues that we did not analyse yet label May 29, 2024
kang-seongbeom added a commit to kang-seongbeom/spring-batch that referenced this issue May 29, 2024
@fmbenhassine
Copy link
Contributor

With Spring Boot 3, it is no longer required to use @EnableBatchProcessing to enable Spring Boot’s auto-configuration of Spring Batch. If you use that annotation, the auto-configuration of batch (including the automatic job execution at startup) will back-off.

There is a section about this change in the migration guide of Spring Boot 3: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#spring-batch-changes . There is also a note as well in the getting started guide of Spring Batch: https://spring.io/guides/gs/batch-processing (See Note how the application does not use the @EnableBatchProcessing annotation..). Is this what you are looking for?

@fmbenhassine fmbenhassine added status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter and removed status: waiting-for-triage Issues that we did not analyse yet labels May 29, 2024
@kang-seongbeom
Copy link
Author

kang-seongbeom commented May 30, 2024

That's right. I was able to remove @EnableBatchProcessing by looking at "https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#spring-batch-changes". However, there is no warning about back-off in "https://docs.spring.io/spring-batch/reference/job/java-config.html". Therefore, I added a cautionary note to “https://github.com/spring-projects/spring-batch/pull/4606”!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter
Projects
None yet
Development

No branches or pull requests

2 participants