简体   繁体   English

春季批处理中有最后一个tasklet吗?

[英]Is there a finally tasklet in spring batch?

Is there a finally tasklet in spring batch? 春季批处理中有最后一个tasklet吗? This task always gets executed regardless of if execution was cancelled, or if a task exceptions out. 无论是否取消执行或任务异常,该任务始终得到执行。 This is used to do any sort of cleanup. 这用于执行任何形式的清理。

I am not finding any useful listeners in documentation. 我在文档中找不到任何有用的侦听器。 Any help will be appreciated. 任何帮助将不胜感激。

I am not finding any useful listeners in documentation 我在文档中找不到任何有用的侦听器

JobExecutionListener#afterJob is what you are looking for. 您正在寻找JobExecutionListener#afterJob It is always called, regardless of the job exit status. 无论作业退出状态如何,总是调用它。 It is the right place to implement any clean-up code. 在这里实现任何清理代码都是正确的地方。

Hope this helps. 希望这可以帮助。

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

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