Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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