Skip to content

Instantly share code, notes, and snippets.

@LokeshAggarwal2
Created August 3, 2020 15:37
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/a0d3256186565487a9f23eb115e22850 to your computer and use it in GitHub Desktop.
Save LokeshAggarwal2/a0d3256186565487a9f23eb115e22850 to your computer and use it in GitHub Desktop.
UserRegistrationResilience4j
@Service
public class UserRegistrationResilience4j {
@Bulkhead(name = "bulkheadService1", fallbackMethod = "bulkHeadFallback")
public String registerSeller(SellerDto sellerDto) throws InterruptedException {
String response = restTemplate.postForObject("/addSeller", sellerDto, String.class);
return response;
}
public String bulkHeadFallback(SellerDto sellerDto, Throwable t) {
logger.error("Inside bulkHeadFallback, cause - {}", t.toString());
return "Inside bulkHeadFallback method. Some error occurred while calling service for seller registration";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment