Class CircuitBreakerClientWithTimeout
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.circuitbreaker.clientserver.CircuitBreakerClientWithTimeout
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSleeps for 1000ms, times out after 500msSleeps for 1000ms, times out after 500ms
-
Constructor Details
-
CircuitBreakerClientWithTimeout
public CircuitBreakerClientWithTimeout()
-
-
Method Details
-
serviceWithTimeout
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=2, failureRatio=0.75, delay=50000L) @Timeout(500L) public String serviceWithTimeout()Sleeps for 1000ms, times out after 500msCircuitBreaker opens after two failed requests
- Returns:
- should always throw TimeoutException, unless CircuitBreaker prevents execution
-
serviceWithTimeoutWithoutFailOn
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=2, failureRatio=0.75, delay=50000L, failOn=org.eclipse.microprofile.faulttolerance.exceptions.BulkheadException.class) @Timeout(500L) public String serviceWithTimeoutWithoutFailOn()Sleeps for 1000ms, times out after 500msCircuitBreaker opens after two BulkheadExceptions
The method should never throw a BulkheadException so the CircuitBreaker should have no effect
- Returns:
- should always throw TimeoutException
-