Nested Class Summary
Nested Classes
static class
A retry strategy that determines the next retry time by adding a fixed
interval to the current time in the specified temporal unit.
static class
A retry strategy that determines the next retry time by adding a fixed
offset and the execution count to the current time in the specified temporal unit.
static class
A retry strategy that determines the next retry time by multiplying
the execution count by a scaling factor and adding the result to the
current time in the specified temporal unit.
Field Summary
Fields
One initial execution and after that we will try it 3 more times.
One initial execution and after that we will try it 3 more times.
Method Summary
All Methods Instance Methods Abstract Methods Default Methods
Calculates the time of the next retry attempt based on the current
execution count and the provided exception.
default boolean
Determines whether a retry should be attempted based on the current
execution count and the provided exception.
Field Details
THREE_RETRIES
One initial execution and after that we will try it 3 more times. Overall 4 executions.
Method Details
shouldRetry
default boolean shouldRetry (int executionCount,
@Nullable
Exception error)
Determines whether a retry should be attempted based on the current
execution count and the provided exception. (optional)
Parameters:
executionCount
- The number of attempts already made.
error
- The exception that triggered the retry.
Returns:
true
if the current execution count is less than
the maximum execution count; false
otherwise.
retryAt
Calculates the time of the next retry attempt based on the current
execution count and the provided exception.
Parameters:
executionCount
- The number of attempts already made.
exception
- The exception that triggered the retry.
Returns:
OffsetDateTime
of the next execution, null
for no retry.