org.eclipse.microprofile.fault.tolerance.tck.circuitbreaker.clientserver

## Class CircuitBreakerClientWithTimeout

- java.lang.Object
- - org.eclipse.microprofile.fault.tolerance.tck.circuitbreaker.clientserver.CircuitBreakerClientWithTimeout

    @RequestScoped
    public class CircuitBreakerClientWithTimeout
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`CircuitBreakerClientWithTimeout()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `serviceWithTimeout()` Sleeps for 1000ms, times out after 500ms
`String` `serviceWithTimeoutWithoutFailOn()` Sleeps for 1000ms, times out after 500ms

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CircuitBreakerClientWithTimeout

    public CircuitBreakerClientWithTimeout()

### Method Detail

#### serviceWithTimeout

    @CircuitBreaker(successThreshold=2,
                    requestVolumeThreshold=2,
                    failureRatio=0.75,
                    delay=50000L)
     @Timeout(value=500L)
    public String serviceWithTimeout()

Sleeps for 1000ms, times out after 500ms

CircuitBreaker 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(value=500L)
    public String serviceWithTimeoutWithoutFailOn()

Sleeps for 1000ms, times out after 500ms

CircuitBreaker opens after two BulkheadExceptions

The method should never throw a BulkheadException so the CircuitBreaker should have no effect

Returns:
  should always throw TimeoutException