@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);
}
}
In this method, I need to retry posting data only when I get certain response codes. I have searched for a few options which isnt suitable for my solution. Is there any simpler way by using annotation?