Class RetryPolicyProperties
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBehavior when retry policy reachesgetMaxAttempts()attempts. -
Constructor Summary
ConstructorsConstructorDescriptionRetryPolicyProperties(@Nullable Duration initialInterval, @Nullable Double exponentiationFactor, @Nullable Duration maxInterval, @Nullable Integer maxAttempts, @Nullable RetryPolicyProperties.OnMaxAttempts onMaxAttempts) -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable DoubleExponential backoff multiplier used to compute the next retry delay.@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 RetryPolicyProperties.OnMaxAttemptsBehavior when the configuredgetMaxAttempts()is reached.inthashCode()voidsetExponentiationFactor(@Nullable Double exponentiationFactor) Exponential backoff multiplier used to compute the next retry delay.voidsetInitialInterval(@Nullable Duration initialInterval) Initial delay before the first retry attempt.voidsetMaxAttempts(@Nullable Integer maxAttempts) Maximum number of attempts before giving up retrying.voidsetMaxInterval(@Nullable Duration maxInterval) Upper bound for the computed retry delay.voidsetOnMaxAttempts(@Nullable RetryPolicyProperties.OnMaxAttempts onMaxAttempts) Behavior when the configuredgetMaxAttempts()is reached.toString()
-
Constructor Details
-
RetryPolicyProperties
public RetryPolicyProperties() -
RetryPolicyProperties
public RetryPolicyProperties(@Nullable Duration initialInterval, @Nullable Double exponentiationFactor, @Nullable Duration maxInterval, @Nullable Integer maxAttempts, @Nullable RetryPolicyProperties.OnMaxAttempts onMaxAttempts)
-
-
Method Details
-
getInitialInterval
Initial delay before the first retry attempt.If unset, the server default is used.
-
setInitialInterval
Initial delay before the first retry attempt.If unset, the server default is used.
-
getExponentiationFactor
Exponential backoff multiplier used to compute the next retry delay.For attempt
n, the next delay is roughlypreviousDelay * exponentiationFactor, capped bygetMaxInterval()if set. -
setExponentiationFactor
Exponential backoff multiplier used to compute the next retry delay.For attempt
n, the next delay is roughlypreviousDelay * exponentiationFactor, capped bygetMaxInterval()if set. -
getMaxInterval
Upper bound for the computed retry delay.If set, any computed delay will not exceed this value.
-
setMaxInterval
Upper bound for the computed retry delay.If set, any computed delay will not exceed this value.
-
getMaxAttempts
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
getOnMaxAttempts()will be applied.- See Also:
-
setMaxAttempts
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
getOnMaxAttempts()will be applied.- See Also:
-
getOnMaxAttempts
Behavior when the configuredgetMaxAttempts()is reached.- See Also:
-
setOnMaxAttempts
Behavior when the configuredgetMaxAttempts()is reached.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-