I have some spring batch jobs that the most of the configuration are the same and have some small changes like the query or item reader. I saw some job and step inheritance using Xml config like this , but I'm looking for similar functionality using spring batch configs E.G, (jobBuilderFactory and StepBuilderFactory). Heare is my job config:
@Bean
public Job job()
{
return jobBuilderFactory.get("job")
.start(master())
.incrementer(new RunIdIncrementer())
.build();
}
and this is one of steps:
@Bean
public Step workerStep()
{
return stepBuilderFactory.get("workerStep")
.<Subscription,ProcessorDto>chunk(chunkSize)
.reader(reader())
.writer(writer())
.processor(processor())
.faultTolerant()
.skip(RuntimeException.class)
.skipLimit(skipLimit)
.build();
}
Thanks in advance for your time and attention.