使用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");
}