spring batch 5
자체 해결우선 해당 질문에 대한 부분 코드는 해결되어서 참고하시라고 공유 드립니다.@Configuration public class HelloJobConfiguration { @Bean public Job helloJob(JobRepository jobRepository, Step helloStep1, Step helloStep2) { return new JobBuilder("helloJob", jobRepository) .start(helloStep1) .next(helloStep2) .build(); } @Bean public Step helloStep1(JobRepository jobRepository, PlatformTransactionManager tx) { return new StepBuilder( "helloStep1", jobRepository) .tasklet((contribution, chunkContext) -> { System.out.println("===================================="); System.out.println(" helloStep1 executed "); System.out.println("===================================="); return RepeatStatus.FINISHED; }, tx).build(); } @Bean public Step helloStep2(JobRepository jobRepository, PlatformTransactionManager tx) { return new StepBuilder( "helloStep2", jobRepository) .tasklet((contribution, chunkContext) -> { System.out.println("===================================="); System.out.println(" helloStep2 executed "); System.out.println("===================================="); return RepeatStatus.FINISHED; }, tx).build(); } }참고로 SpringBatchApplication에서 @EnableBathProcessing 어노테이션 지워야 로그 출력 됩니다. @SpringBootApplication public class SpringBatchApplication { public static void main(String[] args) { SpringApplication.run(SpringBatchApplication.class, args); } }