Created
July 24, 2023 00:52
-
-
Save stfsy/d42e549a8b67001743d793343f25a1b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Supplier<String> supplier = () -> service.sayHelloWorld(param1); | |
String result = Decorators.ofSupplier(supplier) | |
.withBulkhead(Bulkhead.ofDefaults("name")) | |
.withCircuitBreaker(CircuitBreaker.ofDefaults("name")) | |
.withRetry(Retry.ofDefaults("name")) | |
.withFallback(asList(CallNotPermittedException.class, BulkheadFullException.class), | |
throwable -> "Hello from fallback") | |
.get() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment