Closed
Description
The problem
I can't wrap the JobRepository
used by JobBuilderFactory
or StepBuilderFactory
, the default one is being used.
Same type of a problem as presented here #816 .
Implementation issues
AbstractBatchConfiguration
creates JobBuilderFactory
and StepBuilderFactory
as fields.
@Override
public void afterPropertiesSet() throws Exception {
this.jobBuilderFactory = new JobBuilderFactory(jobRepository());
this.stepBuilderFactory = new StepBuilderFactory(jobRepository(), transactionManager());
}
JobRepository
is being injected directly to it from the method bean defitinion
@Bean
public abstract JobRepository jobRepository() throws Exception;
Potential solutions
- do not expose the bean unconditionally
- inject any
JobRepository
not the concrete one - do not create
JobBuilderFactory
norStepBuilderFactory
vianew
.