@RequestScoped public class RetryTimeoutClient extends Object
Constructor and Description |
---|
RetryTimeoutClient() |
Modifier and Type | Method and Description |
---|---|
int |
getCounterForInvokingServiceA() |
int |
getCounterForInvokingServiceWithAbortOn() |
int |
getCounterForInvokingServiceWithoutRetryOn() |
String |
serviceA(long timeToSleep)
Times out after 500ms, retries once
|
String |
serviceWithAbortOn()
Sleeps for 1000ms, times out after 500ms, retries once on anything but TimeoutException
|
String |
serviceWithoutRetryOn()
Sleeps for 1000ms, times out after 500ms, retries once on BulkheadException
|
public int getCounterForInvokingServiceA()
public int getCounterForInvokingServiceWithoutRetryOn()
public int getCounterForInvokingServiceWithAbortOn()
@Timeout(value=500L) @Retry(maxRetries=1) public String serviceA(long timeToSleep)
timeToSleep
- time this method should sleep for in msnull
@Timeout(value=500L) @Retry(maxRetries=1, retryOn=org.eclipse.microprofile.faulttolerance.exceptions.BulkheadException.class) public String serviceWithoutRetryOn()
Method will never throw a BulkheadException so the Retry annotation should have no effect
null
@Timeout(value=500L) @Retry(maxRetries=1, abortOn=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class) public String serviceWithAbortOn()
null
Copyright © 2020 Eclipse Foundation. All rights reserved.