spring-retry - 需要 RetryOperations 吗?
问题描述
使用 retry-spring 时是否需要 RetryOperations ?还是在我的方法上有注释就足够了?
@Retryable(value = {SQLException.class, Exception.class,RuntimeException.class, RetryException.class, ExhaustedRetryException.class}, //retry will be attempted only if the method throws an SQLException.
maxAttempts = 3, backoff = @Backoff (5000))
public boolean sendJmsMessage(final String xml) {
jmsTemplate.send.........()
// logic to send jms
}
@Recover
public void ExhaustedRetryException(ExhaustedRetryException re) {
LOG.error("Failed to deliver the message using the retry");
}
解决方案
推荐阅读
- java - 未找到 Maven“资源”文件夹
- javascript - 在验证脚本中的 AppMaker 中设置字段值
- android - 尝试获取现有数据库,Room Android
- android - 使用 Espresso 测试 React Native 应用程序。分步说明
- vba - 如何从链接表中填充列表框?
- cypress - 如何在 Cypress 中等待两个并行 XHR 请求
- php - move_uploaded_file() 无法移动上传的文件
- arrays - MongoDB/Mongoose:保存 > 将评论推送到数组中,在数组中你会看到评论 + 日期
- django - django 使用 formset 更新多个实例
- php - 如何将帖子值从路由发送到另一个路由名称