You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bean 'jobRegistry' of type [org.springframework.batch.core.configuration.support.MapJobRegistry] is not eligible for getting processed by all BeanPostProcessors. #3
Previously, @EnableBatchProcessing could be used to enable Spring Boot’s auto-configuration of Spring Batch. It is no longer required and should be removed from applications that want to use Boot’s auto-configuration. A bean that is annotated with @EnableBatchProcessing or that extends Batch’s DefaultBatchConfiguration can now be defined to tell the auto-configuration to back off, allowing the application to take complete control of how Batch is configured.
Spring boot 3.0에서는 @EnableBatchProcessing 어노테이션을 권장하지 않는다고 한다. 그런데 해당 어노테이션을 사용하지 않으면 BeanPostProcessorChecker warning이 발생한다. 또한, bean으로 등록한 tasklet은 실행하지 않는다.
그렇다고 @EnableBatchProcessing를 사용하면 아래와 같은 에러가 발생한다. 마찬가지로 step에 등록한 tasklet은 실행되지 않는다.
Bean 'jobRegistry' of type [org.springframework.batch.core.configuration.support.MapJobRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [jobRegistryBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
해당 warning은 spring batch 내부에서 동작하는 jobRegistryBeanPostProcessor의 문제이다. 대안책으로 JobRegistrySmartInitializingSingleton를 사용하는 것을 권장하고 있다. 이는 곧 나올 spring batch 5.2에서 개선될 예정이다.