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 whenmaxAttemptsis 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 classstatic enumBehavior when retry policy reachesmaxAttempts()attempts. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()boolean@Nullable DoubleExponential backoff multiplier used to compute the next retry delay.inthashCode()@Nullable DurationInitial delay before the first retry attempt.@Nullable IntegerMaximum number of attempts before giving up retrying.@Nullable DurationUpper bound for the computed retry delay.@Nullable InvocationRetryPolicy.OnMaxAttemptsBehavior 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.Builderto configure anInvocationRetryPolicy.
-