case class RetryPolicy(maxRetries: Option[Int] = None, initialBackoff: FiniteDuration = FiniteDuration(1000, "ms"), maxBackoff: Option[FiniteDuration] = None, backoffMultiplier: Double = 1.0, jitter: FiniteDuration = FiniteDuration(0, "s"), minJitterThreshold: FiniteDuration = FiniteDuration(0, "s"), canRetry: (Throwable) => Boolean, name: String, recognizeServerRetryDelay: Boolean = false, maxServerRetryDelay: Option[FiniteDuration] = None) extends Product with Serializable
RetryPolicy configure the retry mechanism in GrpcRetryHandler
- maxRetries
Maximum number of retries.
- initialBackoff
Start value of the exponential backoff (ms).
- maxBackoff
Maximal value of the exponential backoff (ms).
- backoffMultiplier
Multiplicative base of the exponential backoff.
- jitter
Sample a random value uniformly from the range [0, jitter] and add it to the backoff.
- minJitterThreshold
Minimal value of the backoff to add random jitter.
- canRetry
Function that determines whether a retry is to be performed in the event of an error.
- name
Name of the policy.
- recognizeServerRetryDelay
Per gRPC standard, the server can send error messages that contain
RetryInfomessage withretry_delayfield indicating that the client should wait for at leastretry_delayamount of time before retrying again, see: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L91 If this flag is set to true, RetryPolicy will useRetryInfo.retry_delayfield in the backoff computation. Server'sretry_delaycan override client'smaxBackoff. This flag does not change which errors are retried, only how the backoff is computed.DefaultPolicyadditionally has a rule for retrying any error that containsRetryInfo.- maxServerRetryDelay
Limit for the server-provided
retry_delay.
- Alphabetic
- By Inheritance
- RetryPolicy
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RetryPolicy(maxRetries: Option[Int] = None, initialBackoff: FiniteDuration = FiniteDuration(1000, "ms"), maxBackoff: Option[FiniteDuration] = None, backoffMultiplier: Double = 1.0, jitter: FiniteDuration = FiniteDuration(0, "s"), minJitterThreshold: FiniteDuration = FiniteDuration(0, "s"), canRetry: (Throwable) => Boolean, name: String, recognizeServerRetryDelay: Boolean = false, maxServerRetryDelay: Option[FiniteDuration] = None)
- maxRetries
Maximum number of retries.
- initialBackoff
Start value of the exponential backoff (ms).
- maxBackoff
Maximal value of the exponential backoff (ms).
- backoffMultiplier
Multiplicative base of the exponential backoff.
- jitter
Sample a random value uniformly from the range [0, jitter] and add it to the backoff.
- minJitterThreshold
Minimal value of the backoff to add random jitter.
- canRetry
Function that determines whether a retry is to be performed in the event of an error.
- name
Name of the policy.
- recognizeServerRetryDelay
Per gRPC standard, the server can send error messages that contain
RetryInfomessage withretry_delayfield indicating that the client should wait for at leastretry_delayamount of time before retrying again, see: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L91 If this flag is set to true, RetryPolicy will useRetryInfo.retry_delayfield in the backoff computation. Server'sretry_delaycan override client'smaxBackoff. This flag does not change which errors are retried, only how the backoff is computed.DefaultPolicyadditionally has a rule for retrying any error that containsRetryInfo.- maxServerRetryDelay
Limit for the server-provided
retry_delay.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val backoffMultiplier: Double
- val canRetry: (Throwable) => Boolean
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getName: String
- val initialBackoff: FiniteDuration
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val jitter: FiniteDuration
- val maxBackoff: Option[FiniteDuration]
- val maxRetries: Option[Int]
- val maxServerRetryDelay: Option[FiniteDuration]
- val minJitterThreshold: FiniteDuration
- val name: String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val recognizeServerRetryDelay: Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toState: RetryPolicyState
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)