如果多步批处理中出现步骤失败,控制台上会显示步骤失败消息。还有BATCH_STATUS就是COMPLETED和EXIT_STATUS是FAILED.
Q.1 如何更改EXIT_STATUS为COMPLETED?
Q.2 是否有可能不在控制台中显示失败消息
示例代码
<job id="someJob" xmlns="http://www.springframework.org/schema/batch"
restartable="true" parent="baseJob">
<step id="aStep">
<job ref="aJob" />
<next on="*" to="bStep"/>
</step>
<step id="bStep" parent="aStep" next="cStep">
<job ref="bJob"/>
</step>
<step id="cStep" parent="bStep">
<job ref="cJob"/>
</step>
</job>
<job id="aJob" xmlns="http://www.springframework.org/schema/batch"
restartable="true" parent="baseJob">
<step id="aJobStep">
<tasklet ref="aJobTasklet" />
</step>
</job>
<job id="bJob" xmlns="http://www.springframework.org/schema/batch"
restartable="true" parent="baseJob">
<step id="bJobStep">
<tasklet ref="bJobTasklet" />
</step>
</job>
<job id="cJob" xmlns="http://www.springframework.org/schema/batch"
restartable="true" parent="baseJob">
<step id="cJobStep">
<tasklet ref="cJobTasklet" />
</step> …Run Code Online (Sandbox Code Playgroud) spring-batch ×1