Class RetryPolicy.RateLimitedRetryBackOff
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
-
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,RetryPolicy.RateLimitedRetryBackOffOrBuilder,Serializable
- Enclosing class:
- RetryPolicy
public static final class RetryPolicy.RateLimitedRetryBackOff extends com.google.protobuf.GeneratedMessageV3 implements RetryPolicy.RateLimitedRetryBackOffOrBuilder
A retry back-off strategy that applies when the upstream server rate limits the request. Given this configuration: .. code-block:: yaml rate_limited_retry_back_off: reset_headers: - name: Retry-After format: SECONDS - name: X-RateLimit-Reset format: UNIX_TIMESTAMP max_interval: "300s" The following algorithm will apply: 1. If the response contains the header ``Retry-After`` its value must be on the form ``120`` (an integer that represents the number of seconds to wait before retrying). If so, this value is used as the back-off interval. 2. Otherwise, if the response contains the header ``X-RateLimit-Reset`` its value must be on the form ``1595320702`` (an integer that represents the point in time at which to retry, as a Unix timestamp in seconds). If so, the current time is subtracted from this value and the result is used as the back-off interval. 3. Otherwise, Envoy will use the default :ref:`exponential back-off <envoy_v3_api_field_config.route.v3.RetryPolicy.retry_back_off>` strategy. No matter which format is used, if the resulting back-off interval exceeds ``max_interval`` it is discarded and the next header in ``reset_headers`` is tried. If a request timeout is configured for the route it will further limit how long the request will be allowed to run. To prevent many clients retrying at the same point in time jitter is added to the back-off interval, so the resulting interval is decided by taking: ``random(interval, interval * 1.5)``. .. attention:: Configuring ``rate_limited_retry_back_off`` will not by itself cause a request to be retried. You will still need to configure the right retry policy to match the responses from the upstream server.Protobuf typeenvoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRetryPolicy.RateLimitedRetryBackOff.BuilderA retry back-off strategy that applies when the upstream server rate limits the request.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_INTERVAL_FIELD_NUMBERstatic intRESET_HEADERS_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static RetryPolicy.RateLimitedRetryBackOffgetDefaultInstance()RetryPolicy.RateLimitedRetryBackOffgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.DurationgetMaxInterval()Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.DurationOrBuildergetMaxIntervalOrBuilder()Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff>getParserForType()RetryPolicy.ResetHeadergetResetHeaders(int index)Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.intgetResetHeadersCount()Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.List<RetryPolicy.ResetHeader>getResetHeadersList()Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.RetryPolicy.ResetHeaderOrBuildergetResetHeadersOrBuilder(int index)Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.List<? extends RetryPolicy.ResetHeaderOrBuilder>getResetHeadersOrBuilderList()Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.intgetSerializedSize()com.google.protobuf.UnknownFieldSetgetUnknownFields()inthashCode()booleanhasMaxInterval()Specifies the maximum back off interval that Envoy will allow.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static RetryPolicy.RateLimitedRetryBackOff.BuildernewBuilder()static RetryPolicy.RateLimitedRetryBackOff.BuildernewBuilder(RetryPolicy.RateLimitedRetryBackOff prototype)RetryPolicy.RateLimitedRetryBackOff.BuildernewBuilderForType()protected RetryPolicy.RateLimitedRetryBackOff.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static RetryPolicy.RateLimitedRetryBackOffparseDelimitedFrom(InputStream input)static RetryPolicy.RateLimitedRetryBackOffparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static RetryPolicy.RateLimitedRetryBackOffparseFrom(byte[] data)static RetryPolicy.RateLimitedRetryBackOffparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static RetryPolicy.RateLimitedRetryBackOffparseFrom(com.google.protobuf.ByteString data)static RetryPolicy.RateLimitedRetryBackOffparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static RetryPolicy.RateLimitedRetryBackOffparseFrom(com.google.protobuf.CodedInputStream input)static RetryPolicy.RateLimitedRetryBackOffparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static RetryPolicy.RateLimitedRetryBackOffparseFrom(InputStream input)static RetryPolicy.RateLimitedRetryBackOffparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static RetryPolicy.RateLimitedRetryBackOffparseFrom(ByteBuffer data)static RetryPolicy.RateLimitedRetryBackOffparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff>parser()RetryPolicy.RateLimitedRetryBackOff.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
RESET_HEADERS_FIELD_NUMBER
public static final int RESET_HEADERS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
MAX_INTERVAL_FIELD_NUMBER
public static final int MAX_INTERVAL_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getResetHeadersList
public List<RetryPolicy.ResetHeader> getResetHeadersList()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response. Headers are tried in order, and matched case insensitive. The first header to be parsed successfully is used. If no headers match the default exponential back-off is used instead.
repeated .envoy.config.route.v3.RetryPolicy.ResetHeader reset_headers = 1 [(.validate.rules) = { ... }- Specified by:
getResetHeadersListin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeadersOrBuilderList
public List<? extends RetryPolicy.ResetHeaderOrBuilder> getResetHeadersOrBuilderList()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response. Headers are tried in order, and matched case insensitive. The first header to be parsed successfully is used. If no headers match the default exponential back-off is used instead.
repeated .envoy.config.route.v3.RetryPolicy.ResetHeader reset_headers = 1 [(.validate.rules) = { ... }- Specified by:
getResetHeadersOrBuilderListin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeadersCount
public int getResetHeadersCount()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response. Headers are tried in order, and matched case insensitive. The first header to be parsed successfully is used. If no headers match the default exponential back-off is used instead.
repeated .envoy.config.route.v3.RetryPolicy.ResetHeader reset_headers = 1 [(.validate.rules) = { ... }- Specified by:
getResetHeadersCountin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeaders
public RetryPolicy.ResetHeader getResetHeaders(int index)
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response. Headers are tried in order, and matched case insensitive. The first header to be parsed successfully is used. If no headers match the default exponential back-off is used instead.
repeated .envoy.config.route.v3.RetryPolicy.ResetHeader reset_headers = 1 [(.validate.rules) = { ... }- Specified by:
getResetHeadersin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeadersOrBuilder
public RetryPolicy.ResetHeaderOrBuilder getResetHeadersOrBuilder(int index)
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response. Headers are tried in order, and matched case insensitive. The first header to be parsed successfully is used. If no headers match the default exponential back-off is used instead.
repeated .envoy.config.route.v3.RetryPolicy.ResetHeader reset_headers = 1 [(.validate.rules) = { ... }- Specified by:
getResetHeadersOrBuilderin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
hasMaxInterval
public boolean hasMaxInterval()
Specifies the maximum back off interval that Envoy will allow. If a reset header contains an interval longer than this then it will be discarded and the next header will be tried. Defaults to 300 seconds.
.google.protobuf.Duration max_interval = 2 [(.validate.rules) = { ... }- Specified by:
hasMaxIntervalin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder- Returns:
- Whether the maxInterval field is set.
-
getMaxInterval
public com.google.protobuf.Duration getMaxInterval()
Specifies the maximum back off interval that Envoy will allow. If a reset header contains an interval longer than this then it will be discarded and the next header will be tried. Defaults to 300 seconds.
.google.protobuf.Duration max_interval = 2 [(.validate.rules) = { ... }- Specified by:
getMaxIntervalin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder- Returns:
- The maxInterval.
-
getMaxIntervalOrBuilder
public com.google.protobuf.DurationOrBuilder getMaxIntervalOrBuilder()
Specifies the maximum back off interval that Envoy will allow. If a reset header contains an interval longer than this then it will be discarded and the next header will be tried. Defaults to 300 seconds.
.google.protobuf.Duration max_interval = 2 [(.validate.rules) = { ... }- Specified by:
getMaxIntervalOrBuilderin interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static RetryPolicy.RateLimitedRetryBackOff parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static RetryPolicy.RateLimitedRetryBackOff parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public RetryPolicy.RateLimitedRetryBackOff.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static RetryPolicy.RateLimitedRetryBackOff.Builder newBuilder()
-
newBuilder
public static RetryPolicy.RateLimitedRetryBackOff.Builder newBuilder(RetryPolicy.RateLimitedRetryBackOff prototype)
-
toBuilder
public RetryPolicy.RateLimitedRetryBackOff.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RetryPolicy.RateLimitedRetryBackOff.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static RetryPolicy.RateLimitedRetryBackOff getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff> parser()
-
getParserForType
public com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public RetryPolicy.RateLimitedRetryBackOff getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-