Retry
为了使处理更健壮且不易出错,有时自动重试失败的操作(以防它在后续尝试中成功)有所帮助。容易出现间歇性故障的错误通常本质上是瞬态的。示例包括由于网络故障而失败的远程 Web 服务调用或数据库更新中的 DeadlockLoserDataAccessException
。
To make processing more robust and less prone to failure, it sometimes helps to
automatically retry a failed operation in case it might succeed on a subsequent attempt.
Errors that are susceptible to intermittent failure are often transient in nature.
Examples include remote calls to a web service that fails because of a network glitch or a
DeadlockLoserDataAccessException
in a database update.
从 2.2.0 版本开始,重试功能已从 Spring Batch 中去除。现在是新库 Spring Retry 的一部分。Spring Batch 仍依赖 Spring Retry 在框架内自动化重试操作。关于主要 API 以及如何使用 API 的详细内容,请查看 Spring Retry 的参考文档。 As of version 2.2.0, the retry functionality was pulled out of Spring Batch. It is now part of a new library, Spring Retry. Spring Batch still relies on Spring Retry to automate retry operations within the framework. See the reference documentation of Spring Retry for details about key APIs and how to use them. |