Created
August 2, 2020 16:12
-
-
Save LokeshAggarwal2/64479425159f7966b09f9159e5e5a795 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 { | |
@CircuitBreaker(name = "service1", fallbackMethod = "fallbackForRegisterSeller") | |
public String registerSeller(SellerDto sellerDto) { | |
String response = restTemplate.postForObject("/addSeller", sellerDto, String.class); | |
return response; | |
} | |
public String fallbackForRegisterSeller(SellerDto sellerDto, Throwable t) { | |
return "Inside circuit breaker fallback method"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment