@ApplicationScoped public class RetryConfigBean extends Object
Constructor and Description |
---|
RetryConfigBean() |
Modifier and Type | Method and Description |
---|---|
void |
serviceAbortOn(RuntimeException e,
AtomicInteger counter) |
void |
serviceDelay() |
void |
serviceJitter()
Method to detect whether jitter is enabled
|
void |
serviceMaxDuration() |
void |
serviceMaxRetries(AtomicInteger counter) |
void |
serviceRetryOn(RuntimeException e,
AtomicInteger counter) |
@Retry(delay=0L, jitter=0L) public void serviceMaxRetries(AtomicInteger counter)
@Retry(maxDuration=10000L, durationUnit=MILLIS, maxRetries=10000, delay=200L, jitter=0L) public void serviceMaxDuration()
@Retry(maxRetries=5, delay=2L, delayUnit=SECONDS, jitter=0L) public void serviceDelay()
@Retry(maxRetries=1, delay=0L, jitter=0L) public void serviceRetryOn(RuntimeException e, AtomicInteger counter)
@Retry(retryOn={TestConfigExceptionA.class,TestConfigExceptionB.class}, abortOn=java.lang.RuntimeException.class, maxRetries=1, delay=0L, jitter=0L) public void serviceAbortOn(RuntimeException e, AtomicInteger counter)
@Retry(abortOn=TestConfigExceptionA.class, delay=0L, jitter=0L, maxRetries=1000, maxDuration=10L, durationUnit=SECONDS) public void serviceJitter()
Will throw TestConfigExceptionA if a delay > 100ms is detected.
Otherwise will throw TestException which will cause a retry.
Limited to 10 seconds or 1000 retries, but will stop as soon as a delay of > 100ms is observed.
Copyright © 2016 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.