Skippable exception classes for Spring Batch with java based configuration

前端 未结 2 1397
攒了一身酷
攒了一身酷 2021-02-07 22:39

I configure a step in XML like this:


        
            

        
2条回答
  •  伪装坚强ぢ
    2021-02-07 22:55

    @Configuration
    @EnableBatchProcessing
    @Import(DataConfig.class)
        public class SpringBatchConfig {
        ..................
        ..................
        @Autowired
        private StepBuilderFactory stepBuilders;
    
        @Bean
        public Step loadSlaveStep()
            return stepBuilders.get("slaveStep")()
           .chunk()
           .faultTolerant()
           .skip(MyException.class)
           .skipLimit(100000)
           .build() 
    }
    

提交回复
热议问题