@RequestScoped public class CircuitBreakerClientWithRetryAsync extends Object implements Serializable
CircuitBreakerClientWithRetry
but methods are annotated
with Asynchronous
Constructor and Description |
---|
CircuitBreakerClientWithRetryAsync() |
Modifier and Type | Method and Description |
---|---|
int |
getCounterForInvokingServiceA() |
int |
getCounterForInvokingServiceB() |
int |
getCounterForInvokingServiceC() |
Future<Connection> |
serviceA() |
Future<Connection> |
serviceB() |
Future<Connection> |
serviceC()
Configured to always time out and Retry until CircuitBreaker is triggered on 4th call.
|
Future<String> |
serviceWithRetryFailOnCbOpen(boolean throwException)
Has a CircuitBreaker and Retries on all exceptions except TestException and CircuitBreakerOpenException
|
Future<String> |
serviceWithRetryOnCbOpen(boolean throwException)
Has a CircuitBreaker and Retries on CircuitBreakerOpenException
|
Future<String> |
serviceWithRetryOnTimeout(boolean throwException)
Has a CircuitBreaker and Retries on TimeoutException
|
public int getCounterForInvokingServiceA()
public int getCounterForInvokingServiceB()
public int getCounterForInvokingServiceC()
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=4, failureRatio=0.75, delay=50000L) @Retry(retryOn=TestException.class, maxRetries=7) @Asynchronous public Future<Connection> serviceA()
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=4, failureRatio=0.75, delay=50000L) @Retry(retryOn=TestException.class, maxRetries=2) @Asynchronous public Future<Connection> serviceB()
@CircuitBreaker(successThreshold=2, requestVolumeThreshold=4, failureRatio=0.75, delay=50000L) @Retry(retryOn={TestException.class,org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class}, maxRetries=7, maxDuration=20000L) @Timeout(value=100L) @Asynchronous public Future<Connection> serviceC()
@CircuitBreaker(requestVolumeThreshold=4, failureRatio=0.75, delay=1000L) @Retry(retryOn=org.eclipse.microprofile.faulttolerance.exceptions.CircuitBreakerOpenException.class, maxRetries=20, delay=100L, jitter=0L) @Asynchronous public Future<String> serviceWithRetryOnCbOpen(boolean throwException)
throwException
- whether this method should throw a runtime exception to simulate an application failure@CircuitBreaker(requestVolumeThreshold=4, failureRatio=0.75, delay=1000L) @Retry(retryOn=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class, maxRetries=20, delay=200L) @Asynchronous public Future<String> serviceWithRetryOnTimeout(boolean throwException)
The method should never throw a TimeoutException so the retry should have no effect
throwException
- whether this method should throw a TestException to simulate an application failure@CircuitBreaker(requestVolumeThreshold=4, failureRatio=0.75, delay=1000L) @Retry(abortOn={TestException.class,org.eclipse.microprofile.faulttolerance.exceptions.CircuitBreakerOpenException.class}, maxRetries=20, delay=200L) @Asynchronous public Future<String> serviceWithRetryFailOnCbOpen(boolean throwException)
throwException
- whether this method should throw a TestException to simulate an application failureCopyright © 2020 Eclipse Foundation. All rights reserved.