Identified depracations and updated the code
This commit is contained in:
@@ -60,19 +60,19 @@ public class BatchEventsApplication {
|
||||
|
||||
@Bean
|
||||
public Step step1() {
|
||||
return new StepBuilder("step1").repository(this.jobRepository).tasklet(new Tasklet() {
|
||||
return new StepBuilder("step1", this.jobRepository).tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
System.out.println("Tasklet has run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
}).transactionManager(transactionManager).build();
|
||||
}, transactionManager).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Step step2() {
|
||||
return new StepBuilder("step2").repository(this.jobRepository)
|
||||
.<String, String>chunk(DEFAULT_CHUNK_COUNT)
|
||||
return new StepBuilder("step2", this.jobRepository)
|
||||
.<String, String>chunk(DEFAULT_CHUNK_COUNT, this.transactionManager)
|
||||
.reader(new ListItemReader<>(Arrays.asList("1", "2", "3", "4", "5", "6")))
|
||||
.processor(new ItemProcessor<String, String>() {
|
||||
@Override
|
||||
@@ -88,13 +88,12 @@ public class BatchEventsApplication {
|
||||
}
|
||||
}
|
||||
})
|
||||
.transactionManager(transactionManager)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Job job() {
|
||||
return new JobBuilder("job").repository(this.jobRepository).start(step1()).next(step2()).build();
|
||||
return new JobBuilder("job", this.jobRepository).start(step1()).next(step2()).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user