Package 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
Description
`CircuitBreakerClientWithTimeout()`

## Method Summary

Modifier and Type
Method
Description
`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 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 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(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