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 classA 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,BuilderT>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final RetryPolicy.RateLimitedRetryBackOffstatic final intprivate com.google.protobuf.Durationprivate byteprivate static final com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff> static final intprivate List<RetryPolicy.ResetHeader> private static final longFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateRateLimitedRetryBackOff(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.Descriptorcom.google.protobuf.DurationSpecifies the maximum back off interval that Envoy will allow.com.google.protobuf.DurationOrBuilderSpecifies 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.intSpecifies 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.intinthashCode()booleanSpecifies the maximum back off interval that Envoy will allow.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilder(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()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, 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() -
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein 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:
getResetHeadersListin 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:
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
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
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.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- 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
- 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:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
public static RetryPolicy.RateLimitedRetryBackOff.Builder newBuilder(RetryPolicy.RateLimitedRetryBackOff prototype) -
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RetryPolicy.RateLimitedRetryBackOff.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-