Class InvocationRetryPolicy
java.lang.Object
dev.restate.sdk.endpoint.definition.InvocationRetryPolicy
Retry policy used by Restate when retrying failed handler invocations.
This policy controls an exponential backoff with optional capping and a terminal action:
initialInterval
: delay before the first retry attempt.exponentiationFactor
: multiplier applied to the previous delay to compute the next delay.maxInterval
: upper bound for any computed delay.maxAttempts
: maximum number of attempts (initial call counts as the first attempt).onMaxAttempts
: what to do whenmaxAttempts
is reached.
Unset fields inherit the corresponding defaults from the Restate server configuration. Implementations may also enforce system-wide minimum/maximum bounds.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
Behavior when retry policy reachesmaxAttempts()
attempts. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
@Nullable Double
Exponential backoff multiplier used to compute the next retry delay.int
hashCode()
@Nullable Duration
Initial delay before the first retry attempt.@Nullable Integer
Maximum number of attempts before giving up retrying.@Nullable Duration
Upper bound for the computed retry delay.@Nullable InvocationRetryPolicy.OnMaxAttempts
Behavior when the configuredmaxAttempts()
is reached.toString()
-
Method Details
-
initialInterval
Initial delay before the first retry attempt.If unset, the server default is used.
-
exponentiationFactor
Exponential backoff multiplier used to compute the next retry delay.For attempt
n
, the next delay is roughlypreviousDelay * exponentiationFactor
, capped bymaxInterval()
if set. -
maxInterval
Upper bound for the computed retry delay.If set, any computed delay will not exceed this value.
-
maxAttempts
Maximum number of attempts before giving up retrying.The initial call counts as the first attempt; retries increment the count by 1. When giving up, the behavior defined with
onMaxAttempts()
will be applied.- See Also:
-
onMaxAttempts
Behavior when the configuredmaxAttempts()
is reached.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
- Returns:
- a new
InvocationRetryPolicy.Builder
to configure anInvocationRetryPolicy
.
-