Closed
Description
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: