Deprecate jobRepository method in JobBuilderHelper & StepBuilderHelper
acktsap opened this issue · 1 comments
acktsap commented
As of 5.0.0, it's recommanded to use JobBuilder, StepBuilder with JobRepository
like this.
@Bean
public Job testJob(JobRepository jobRepository) {
return new JobBuilder("testJob", jobRepository)
.start(
new StepBuilder("testStep", jobRepository)
.tasklet((a, b) -> RepeatStatus.FINISHED, new ResourcelessTransactionManager())
.build()
)
.build();
}
But i still can set JobRepository
when building Job
or Step
like this.
@Bean
public Job testJob(JobRepository jobRepository) {
return new JobBuilder("testJob", jobRepository)
.start(
new StepBuilder("testStep", jobRepository)
.tasklet((a, b) -> RepeatStatus.FINISHED, new ResourcelessTransactionManager())
.repository(jobRepository) // this
.build()
)
.repository(jobRepository) // this
.build();
}
It looks redundant since it's already set in constructor. So, how about remove repository method in JobBuilderHelper
and StepBuilderHelper
? Maybe it's better to deprecate first and remove in 6.0.0
fmbenhassine commented
Thank you for reporting this. It makes sense, and indeed, it could be confusing. I will plan the deprecation for v5.1.