Spring Batch:如果ExecutionContextPromotionListener无法保存作业参数,会发生什么?

时间:2018-01-28 09:35:51

标签: java spring spring-batch

我试图理解StepExecutionListener。在我的测试中,Spring Batch会忽略在侦听器中抛出的异常(例如,在afterStepExecutionContextPromotionListener中)。我可以在日志文件中看到异常,但作业仍然有效,并以ExitStatus COMPLETED 完成。

现在我想知道如果ExecutionContextPromotionListener无法在弹簧批处理数据库中将步骤执行参数保存为作业参数,如果在那个时刻不可用,会发生什么?

如果作业继续,我将永远无法在下一步中获得作业参数。这是一种非常令人不快和意外的行为 - 特别是因为此过程被建议作为最佳实践:https://docs.spring.io/spring-batch/trunk/reference/html/patterns.html#passingDataToFutureSteps

我是否误解了某些内容或ExecutionContextPromotionListener在此错误情况下是否无法正常工作?

0 个答案:

没有答案