Class RetryPolicy.RateLimitedRetryBackOff
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
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.GeneratedMessage
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 type
envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A retry back-off strategy that applies when the upstream server rate limits the request.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,
BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParent
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final RetryPolicy.RateLimitedRetryBackOff
static final int
private com.google.protobuf.Duration
private byte
private static final com.google.protobuf.Parser
<RetryPolicy.RateLimitedRetryBackOff> static final int
private List
<RetryPolicy.ResetHeader> private static final long
Fields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFields
Fields inherited from class com.google.protobuf.AbstractMessage
memoizedSize
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
RateLimitedRetryBackOff
(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Duration
Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.DurationOrBuilder
Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.Parser
<RetryPolicy.RateLimitedRetryBackOff> getResetHeaders
(int index) Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.int
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.getResetHeadersOrBuilder
(int index) Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.List
<? extends RetryPolicy.ResetHeaderOrBuilder> Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.int
int
hashCode()
boolean
Specifies the maximum back off interval that Envoy will allow.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
newBuilder
(RetryPolicy.RateLimitedRetryBackOff prototype) newBuilderForType
(com.google.protobuf.AbstractMessage.BuilderParent parent) parseDelimitedFrom
(InputStream input) parseDelimitedFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(byte[] data) parseFrom
(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(com.google.protobuf.ByteString data) parseFrom
(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(com.google.protobuf.CodedInputStream input) parseFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(InputStream input) parseFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(ByteBuffer data) parseFrom
(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser
<RetryPolicy.RateLimitedRetryBackOff> parser()
void
writeTo
(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, 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, hashFields, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
bitField0_
private int bitField0_ -
RESET_HEADERS_FIELD_NUMBER
public static final int RESET_HEADERS_FIELD_NUMBER- See Also:
-
resetHeaders_
-
MAX_INTERVAL_FIELD_NUMBER
public static final int MAX_INTERVAL_FIELD_NUMBER- See Also:
-
maxInterval_
private com.google.protobuf.Duration maxInterval_ -
memoizedIsInitialized
private byte memoizedIsInitialized -
DEFAULT_INSTANCE
-
PARSER
-
-
Constructor Details
-
RateLimitedRetryBackOff
private RateLimitedRetryBackOff(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
RateLimitedRetryBackOff
private RateLimitedRetryBackOff()
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage
-
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:
getResetHeadersList
in interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
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:
getResetHeadersOrBuilderList
in 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:
getResetHeadersCount
in interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeaders
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:
getResetHeaders
in interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeadersOrBuilder
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:
getResetHeadersOrBuilder
in 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:
hasMaxInterval
in 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:
getMaxInterval
in 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:
getMaxIntervalOrBuilder
in interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in 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
- 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
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
public static RetryPolicy.RateLimitedRetryBackOff.Builder newBuilder(RetryPolicy.RateLimitedRetryBackOff prototype) -
toBuilder
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RetryPolicy.RateLimitedRetryBackOff.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForType
in classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-