public class IntervalRetryScheduler extends AbstractRetryScheduler
Modifier and Type | Class and Description |
---|---|
static class |
IntervalRetryScheduler.Builder
Builder class to instantiate a
IntervalRetryScheduler . |
Modifier | Constructor and Description |
---|---|
protected |
IntervalRetryScheduler(IntervalRetryScheduler.Builder builder)
Instantiate a
IntervalRetryScheduler based on the fields contained in the IntervalRetryScheduler.Builder . |
Modifier and Type | Method and Description |
---|---|
static IntervalRetryScheduler.Builder |
builder()
Instantiate a Builder to be able to create a
IntervalRetryScheduler . |
protected long |
computeRetryInterval(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures)
Compute the amount of milliseconds delay until the next retry, given the information passed.
|
isExplicitlyNonTransient, scheduleRetry, scheduleRetry
protected IntervalRetryScheduler(IntervalRetryScheduler.Builder builder)
IntervalRetryScheduler
based on the fields contained in the IntervalRetryScheduler.Builder
.
Will assert that the retryInterval
and maxRetryCount
are positive numbers, and that the
ScheduledExecutorService
is not null
. If any of these does not hold, an
AxonConfigurationException
will be thrown.
builder
- the IntervalRetryScheduler.Builder
used to instantiate a IntervalRetryScheduler
instanceprotected long computeRetryInterval(CommandMessage commandMessage, RuntimeException lastFailure, List<Class<? extends Throwable>[]> failures)
AbstractRetryScheduler
computeRetryInterval
in class AbstractRetryScheduler
commandMessage
- the command that was sent (and failed).lastFailure
- the last failure that caused this retry scheduler to be called.failures
- a List
of all failures up to now.public static IntervalRetryScheduler.Builder builder()
IntervalRetryScheduler
.
The default for retryInterval
is set to 100ms, while maxRetryCount
gets a single retry.
The ScheduledExecutorService
is a hard requirement and as such should be provided.
IntervalRetryScheduler
Copyright © 2010–2022. All rights reserved.