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
,java.io.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 typeenvoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetryPolicy.RateLimitedRetryBackOff.Builder
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 extends java.lang.Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description private int
bitField0_
private static RetryPolicy.RateLimitedRetryBackOff
DEFAULT_INSTANCE
static int
MAX_INTERVAL_FIELD_NUMBER
private com.google.protobuf.Duration
maxInterval_
private byte
memoizedIsInitialized
private static com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff>
PARSER
static int
RESET_HEADERS_FIELD_NUMBER
private java.util.List<RetryPolicy.ResetHeader>
resetHeaders_
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description private
RateLimitedRetryBackOff()
private
RateLimitedRetryBackOff(com.google.protobuf.GeneratedMessage.Builder<?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static RetryPolicy.RateLimitedRetryBackOff
getDefaultInstance()
RetryPolicy.RateLimitedRetryBackOff
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Duration
getMaxInterval()
Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.DurationOrBuilder
getMaxIntervalOrBuilder()
Specifies the maximum back off interval that Envoy will allow.com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff>
getParserForType()
RetryPolicy.ResetHeader
getResetHeaders(int index)
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.int
getResetHeadersCount()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.java.util.List<RetryPolicy.ResetHeader>
getResetHeadersList()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.RetryPolicy.ResetHeaderOrBuilder
getResetHeadersOrBuilder(int index)
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.java.util.List<? extends RetryPolicy.ResetHeaderOrBuilder>
getResetHeadersOrBuilderList()
Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``) to match against the response.int
getSerializedSize()
int
hashCode()
boolean
hasMaxInterval()
Specifies the maximum back off interval that Envoy will allow.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
static RetryPolicy.RateLimitedRetryBackOff.Builder
newBuilder()
static RetryPolicy.RateLimitedRetryBackOff.Builder
newBuilder(RetryPolicy.RateLimitedRetryBackOff prototype)
RetryPolicy.RateLimitedRetryBackOff.Builder
newBuilderForType()
protected RetryPolicy.RateLimitedRetryBackOff.Builder
newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
static RetryPolicy.RateLimitedRetryBackOff
parseDelimitedFrom(java.io.InputStream input)
static RetryPolicy.RateLimitedRetryBackOff
parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(byte[] data)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(com.google.protobuf.ByteString data)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(com.google.protobuf.CodedInputStream input)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(java.io.InputStream input)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(java.nio.ByteBuffer data)
static RetryPolicy.RateLimitedRetryBackOff
parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff>
parser()
RetryPolicy.RateLimitedRetryBackOff.Builder
toBuilder()
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bitField0_
private int bitField0_
-
RESET_HEADERS_FIELD_NUMBER
public static final int RESET_HEADERS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
resetHeaders_
private java.util.List<RetryPolicy.ResetHeader> resetHeaders_
-
MAX_INTERVAL_FIELD_NUMBER
public static final int MAX_INTERVAL_FIELD_NUMBER
- See Also:
- Constant Field Values
-
maxInterval_
private com.google.protobuf.Duration maxInterval_
-
memoizedIsInitialized
private byte memoizedIsInitialized
-
DEFAULT_INSTANCE
private static final RetryPolicy.RateLimitedRetryBackOff DEFAULT_INSTANCE
-
PARSER
private static final com.google.protobuf.Parser<RetryPolicy.RateLimitedRetryBackOff> PARSER
-
-
Method Detail
-
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
public java.util.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:
getResetHeadersList
in interfaceRetryPolicy.RateLimitedRetryBackOffOrBuilder
-
getResetHeadersOrBuilderList
public java.util.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:
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
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:
getResetHeaders
in 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:
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
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
java.io.IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
public boolean equals(java.lang.Object obj)
- 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(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(java.nio.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(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static RetryPolicy.RateLimitedRetryBackOff parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static RetryPolicy.RateLimitedRetryBackOff parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RetryPolicy.RateLimitedRetryBackOff parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
newBuilderForType
public RetryPolicy.RateLimitedRetryBackOff.Builder newBuilderForType()
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in 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:
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
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:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
public RetryPolicy.RateLimitedRetryBackOff getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-