Skip to content

Instantly share code, notes, and snippets.

@LokeshAggarwal2
Created September 15, 2020 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LokeshAggarwal2/a124d52ad5fe63af6bd38986729b5d26 to your computer and use it in GitHub Desktop.
Save LokeshAggarwal2/a124d52ad5fe63af6bd38986729b5d26 to your computer and use it in GitHub Desktop.
@Retry(name = "retryService", fallbackMethod = "retryfallback")
public String registerUser(String data) throws InterruptedException {
return restTemplate.postForObject("http://lokeshaggarwal-eval-prod.apigee.net/createuser", data, String.class);
}
public String retryfallback(String data, Throwable t) {
logger.error("Inside retryfallback, cause - {}", t.toString());
return "Inside retryfallback method. Some error occurred while calling service for user registration";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment