Class RetryTimeoutClient
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.retrytimeout.clientserver.RetryTimeoutClient
A client to demonstrate the combination of the @Retry and @Timeout annotations.
- Author:
- Neil Young
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
serviceA
(long timeToSleep) Times out after 500ms, retries onceSleeps for 1000ms, times out after 500ms, retries once on anything but TimeoutExceptionSleeps for 1000ms, times out after 500ms, retries once on BulkheadException
-
Constructor Details
-
RetryTimeoutClient
public RetryTimeoutClient()
-
-
Method Details
-
getCounterForInvokingServiceA
public int getCounterForInvokingServiceA() -
getCounterForInvokingServiceWithoutRetryOn
public int getCounterForInvokingServiceWithoutRetryOn() -
getCounterForInvokingServiceWithAbortOn
public int getCounterForInvokingServiceWithAbortOn() -
serviceA
Times out after 500ms, retries once- Parameters:
timeToSleep
- time this method should sleep for in ms- Returns:
null
-
serviceWithoutRetryOn
@Timeout(500L) @Retry(maxRetries=1, retryOn=org.eclipse.microprofile.faulttolerance.exceptions.BulkheadException.class) public String serviceWithoutRetryOn()Sleeps for 1000ms, times out after 500ms, retries once on BulkheadExceptionMethod will never throw a BulkheadException so the Retry annotation should have no effect
- Returns:
null
-
serviceWithAbortOn
@Timeout(500L) @Retry(maxRetries=1, abortOn=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class) public String serviceWithAbortOn()Sleeps for 1000ms, times out after 500ms, retries once on anything but TimeoutException- Returns:
null
-