@RequestScoped public class CircuitBreakerClientWithTimeout extends Object
Constructor and Description |
---|
CircuitBreakerClientWithTimeout() |
Modifier and Type | Method and Description |
---|---|
String |
serviceWithTimeout()
Sleeps for 1000ms, times out after 500ms
|
String |
serviceWithTimeoutWithoutFailOn()
Sleeps for 1000ms, times out after 500ms
|
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=2, failureRatio=0.75, delay=50000L) @Timeout(value=500L) public String serviceWithTimeout()
CircuitBreaker opens after two failed requests
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=2, failureRatio=0.75, delay=50000L, failOn=org.eclipse.microprofile.faulttolerance.exceptions.BulkheadException.class) @Timeout(value=500L) public String serviceWithTimeoutWithoutFailOn()
CircuitBreaker opens after two BulkheadExceptions
The method should never throw a BulkheadException so the CircuitBreaker should have no effect
Copyright © 2016 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.