Created
August 3, 2020 15:37
-
-
Save LokeshAggarwal2/a0d3256186565487a9f23eb115e22850 to your computer and use it in GitHub Desktop.
UserRegistrationResilience4j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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