@Retryable(value = ABCDException.class,
maxAttemptsExpression = 3,
backoff = @Backoff(delayExpression = "#{${application.delay}}"))
public String postABCDrequest(ABCDrequest abcdRequest) throws ABCDException {
try {
return restCalltopostData(abcdRequest);
} catch (AnyException e) {
log.error("Error Occured ", e);
throw new ABCDException("Error Occured ", e);
}
}
在这种方法中,只有当我得到某些响应代码时,我才需要重试发布数据。我搜索了一些不适合我的解决方案的选项。使用注释有没有更简单的方法?