Batch Job Flow
Batch Step
Next
@Slf4j
@Configuration
@RequiredArgsConstructor
public class StepNextJobConfiguration {
private final JobBuilderFactory jobBuilderFactory;
private final StepBuilderFactory stepBuilderFactory;
@Bean
public Job stepNextJob(){
return jobBuilderFactory.get("stepNextJob")
.start(step1())
.next(step2())
.next(step3())
.build();
}
@Bean
public Step step1(){
return stepBuilderFactory.get("step1")
.tasklet((stepContribution, chunkContext) -> {
log.info(">>> this is step1");
return RepeatStatus.FINISHED;
}).build();
}
@Bean
public Step step2(){
return stepBuilderFactory.get("step2")
.tasklet((stepContribution, chunkContext) -> {
log.info(">>> this is step2");
return RepeatStatus.FINISHED;
}).build();
}
@Bean
public Step step3(){
return stepBuilderFactory.get("step3")
.tasklet((stepContribution, chunkContext) -> {
log.info(">>> this is step3");
return RepeatStatus.FINISHED;
}).build();
}
}Flow

.on()
.on().to()
.to().from()
.from().end()
.end()Flow 수행 해보기
Decide
BatchStatus vs ExitStatus
BatchStatus
ExitStatus
Custom ExitStatus
참고
Last updated