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 maxRetryCount
is set to a single retry, the backoffFactor
defaults to 100ms and
the nonTransientFailurePredicate
defaults to AxonNonTransientExceptionClassesPredicate
.
The ScheduledExecutorService
is a hard requirement and as such should be provided.
IntervalRetryScheduler
Copyright © 2010–2024. All rights reserved.