简体   繁体   English

如果步骤失败,Spring Batch退出作业

[英]Spring Batch Exit Job If Step Fails

I want a job to exit if a step within the job fails. 如果作业中的某个步骤失败,我希望作业退出。 I'm using Spring Batch annotation and not XML. 我正在使用Spring Batch批注而不是XML。

I have a job step defined below: 我的工作步骤定义如下:

@Bean(name = "callM204Step")
    public Step callM204Step(StepBuilderFactory stepFactory, CallM204ProgramTasklet task) {
        return stepFactory.get("callM204Step") //
                .tasklet(task) //
                .allowStartIfComplete(true) //
                .build();
    }

If this step fails, how can I exit the job? 如果此步骤失败,如何退出工作?

I wasn't aware that if a step fails the job also fails. 我不知道如果某个步骤失败了,那么工作也会失败。 Thank you. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM