Class RetryPolicyProperties

java.lang.Object
dev.restate.sdk.springboot.RetryPolicyProperties

public class RetryPolicyProperties extends Object
Configuration properties for Restate's retry policy 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 when maxAttempts is reached.

Unset fields inherit the corresponding defaults from the Restate server configuration.

See Also:
  • Constructor Details

  • Method Details

    • getInitialInterval

      public @Nullable Duration getInitialInterval()
      Initial delay before the first retry attempt.

      If unset, the server default is used.

    • setInitialInterval

      public void setInitialInterval(@Nullable Duration initialInterval)
      Initial delay before the first retry attempt.

      If unset, the server default is used.

    • getExponentiationFactor

      public @Nullable Double getExponentiationFactor()
      Exponential backoff multiplier used to compute the next retry delay.

      For attempt n, the next delay is roughly previousDelay * exponentiationFactor, capped by getMaxInterval() if set.

    • setExponentiationFactor

      public void setExponentiationFactor(@Nullable Double exponentiationFactor)
      Exponential backoff multiplier used to compute the next retry delay.

      For attempt n, the next delay is roughly previousDelay * exponentiationFactor, capped by getMaxInterval() if set.

    • getMaxInterval

      public @Nullable Duration getMaxInterval()
      Upper bound for the computed retry delay.

      If set, any computed delay will not exceed this value.

    • setMaxInterval

      public void setMaxInterval(@Nullable Duration maxInterval)
      Upper bound for the computed retry delay.

      If set, any computed delay will not exceed this value.

    • getMaxAttempts

      public @Nullable Integer 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

      public void setMaxAttempts(@Nullable Integer 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 getOnMaxAttempts() will be applied.

      See Also:
    • getOnMaxAttempts

      public @Nullable RetryPolicyProperties.OnMaxAttempts getOnMaxAttempts()
      Behavior when the configured getMaxAttempts() is reached.
      See Also:
    • setOnMaxAttempts

      public void setOnMaxAttempts(@Nullable RetryPolicyProperties.OnMaxAttempts onMaxAttempts)
      Behavior when the configured getMaxAttempts() is reached.
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object