Record Class ServiceConfig.MethodConfig.RetryPolicy

java.lang.Object
java.lang.Record
org.springframework.boot.grpc.client.autoconfigure.ServiceConfig.MethodConfig.RetryPolicy
Record Components:
maxAttempts - maximum number of RPC attempts, including the original attempt
initialBackoff - initial exponential backoff
maxBackoff - maximum exponential backoff
backoffMultiplier - exponential backoff multiplier
perAttemptReceiveTimeout - per-attempt receive timeout
retryableStatusCodes - status codes which may be retried
Enclosing class:
ServiceConfig.MethodConfig

public static record ServiceConfig.MethodConfig.RetryPolicy(Integer maxAttempts, Duration initialBackoff, Duration maxBackoff, Double backoffMultiplier, Duration perAttemptReceiveTimeout, Set<io.grpc.Status.Code> retryableStatusCodes) extends Record
Retry policy for outgoing RPCs.
Since:
4.1.0
Author:
Phillip Webb
  • Constructor Details

    • RetryPolicy

      public RetryPolicy(Integer maxAttempts, Duration initialBackoff, Duration maxBackoff, Double backoffMultiplier, Duration perAttemptReceiveTimeout, Set<io.grpc.Status.Code> retryableStatusCodes)
      Creates an instance of a RetryPolicy record class.
      Parameters:
      maxAttempts - the value for the maxAttempts record component
      initialBackoff - the value for the initialBackoff record component
      maxBackoff - the value for the maxBackoff record component
      backoffMultiplier - the value for the backoffMultiplier record component
      perAttemptReceiveTimeout - the value for the perAttemptReceiveTimeout record component
      retryableStatusCodes - the value for the retryableStatusCodes record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxAttempts

      public Integer maxAttempts()
      Returns the value of the maxAttempts record component.
      Returns:
      the value of the maxAttempts record component
    • initialBackoff

      public Duration initialBackoff()
      Returns the value of the initialBackoff record component.
      Returns:
      the value of the initialBackoff record component
    • maxBackoff

      public Duration maxBackoff()
      Returns the value of the maxBackoff record component.
      Returns:
      the value of the maxBackoff record component
    • backoffMultiplier

      public Double backoffMultiplier()
      Returns the value of the backoffMultiplier record component.
      Returns:
      the value of the backoffMultiplier record component
    • perAttemptReceiveTimeout

      public Duration perAttemptReceiveTimeout()
      Returns the value of the perAttemptReceiveTimeout record component.
      Returns:
      the value of the perAttemptReceiveTimeout record component
    • retryableStatusCodes

      public Set<io.grpc.Status.Code> retryableStatusCodes()
      Returns the value of the retryableStatusCodes record component.
      Returns:
      the value of the retryableStatusCodes record component