Class RetryPolicy

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, RetryPolicyOrBuilder, Serializable

    public final class RetryPolicy
    extends com.google.protobuf.GeneratedMessageV3
    implements RetryPolicyOrBuilder
     HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.
     [#next-free-field: 11]
     
    Protobuf type envoy.api.v2.route.RetryPolicy
    See Also:
    Serialized Form
    • Field Detail

      • NUM_RETRIES_FIELD_NUMBER

        public static final int NUM_RETRIES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PER_TRY_TIMEOUT_FIELD_NUMBER

        public static final int PER_TRY_TIMEOUT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRY_PRIORITY_FIELD_NUMBER

        public static final int RETRY_PRIORITY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRY_HOST_PREDICATE_FIELD_NUMBER

        public static final int RETRY_HOST_PREDICATE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • HOST_SELECTION_RETRY_MAX_ATTEMPTS_FIELD_NUMBER

        public static final int HOST_SELECTION_RETRY_MAX_ATTEMPTS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRIABLE_STATUS_CODES_FIELD_NUMBER

        public static final int RETRIABLE_STATUS_CODES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRY_BACK_OFF_FIELD_NUMBER

        public static final int RETRY_BACK_OFF_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRIABLE_HEADERS_FIELD_NUMBER

        public static final int RETRIABLE_HEADERS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETRIABLE_REQUEST_HEADERS_FIELD_NUMBER

        public static final int RETRIABLE_REQUEST_HEADERS_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getRetryOn

        public String getRetryOn()
         Specifies the conditions under which retry takes place. These are the same
         conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and
         :ref:`config_http_filters_router_x-envoy-retry-grpc-on`.
         
        string retry_on = 1;
        Specified by:
        getRetryOn in interface RetryPolicyOrBuilder
        Returns:
        The retryOn.
      • getRetryOnBytes

        public com.google.protobuf.ByteString getRetryOnBytes()
         Specifies the conditions under which retry takes place. These are the same
         conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and
         :ref:`config_http_filters_router_x-envoy-retry-grpc-on`.
         
        string retry_on = 1;
        Specified by:
        getRetryOnBytes in interface RetryPolicyOrBuilder
        Returns:
        The bytes for retryOn.
      • hasNumRetries

        public boolean hasNumRetries()
         Specifies the allowed number of retries. This parameter is optional and
         defaults to 1. These are the same conditions documented for
         :ref:`config_http_filters_router_x-envoy-max-retries`.
         
        .google.protobuf.UInt32Value num_retries = 2;
        Specified by:
        hasNumRetries in interface RetryPolicyOrBuilder
        Returns:
        Whether the numRetries field is set.
      • getNumRetries

        public com.google.protobuf.UInt32Value getNumRetries()
         Specifies the allowed number of retries. This parameter is optional and
         defaults to 1. These are the same conditions documented for
         :ref:`config_http_filters_router_x-envoy-max-retries`.
         
        .google.protobuf.UInt32Value num_retries = 2;
        Specified by:
        getNumRetries in interface RetryPolicyOrBuilder
        Returns:
        The numRetries.
      • getNumRetriesOrBuilder

        public com.google.protobuf.UInt32ValueOrBuilder getNumRetriesOrBuilder()
         Specifies the allowed number of retries. This parameter is optional and
         defaults to 1. These are the same conditions documented for
         :ref:`config_http_filters_router_x-envoy-max-retries`.
         
        .google.protobuf.UInt32Value num_retries = 2;
        Specified by:
        getNumRetriesOrBuilder in interface RetryPolicyOrBuilder
      • hasPerTryTimeout

        public boolean hasPerTryTimeout()
         Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The
         same conditions documented for
         :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
         .. note::
           If left unspecified, Envoy will use the global
           :ref:`route timeout <envoy_api_field_route.RouteAction.timeout>` for the request.
           Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
           retry policy, a request that times out will not be retried as the total timeout budget
           would have been exhausted.
         
        .google.protobuf.Duration per_try_timeout = 3;
        Specified by:
        hasPerTryTimeout in interface RetryPolicyOrBuilder
        Returns:
        Whether the perTryTimeout field is set.
      • getPerTryTimeout

        public com.google.protobuf.Duration getPerTryTimeout()
         Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The
         same conditions documented for
         :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
         .. note::
           If left unspecified, Envoy will use the global
           :ref:`route timeout <envoy_api_field_route.RouteAction.timeout>` for the request.
           Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
           retry policy, a request that times out will not be retried as the total timeout budget
           would have been exhausted.
         
        .google.protobuf.Duration per_try_timeout = 3;
        Specified by:
        getPerTryTimeout in interface RetryPolicyOrBuilder
        Returns:
        The perTryTimeout.
      • getPerTryTimeoutOrBuilder

        public com.google.protobuf.DurationOrBuilder getPerTryTimeoutOrBuilder()
         Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The
         same conditions documented for
         :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
         .. note::
           If left unspecified, Envoy will use the global
           :ref:`route timeout <envoy_api_field_route.RouteAction.timeout>` for the request.
           Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
           retry policy, a request that times out will not be retried as the total timeout budget
           would have been exhausted.
         
        .google.protobuf.Duration per_try_timeout = 3;
        Specified by:
        getPerTryTimeoutOrBuilder in interface RetryPolicyOrBuilder
      • hasRetryPriority

        public boolean hasRetryPriority()
         Specifies an implementation of a RetryPriority which is used to determine the
         distribution of load across priorities used for retries. Refer to
         :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
         
        .envoy.api.v2.route.RetryPolicy.RetryPriority retry_priority = 4;
        Specified by:
        hasRetryPriority in interface RetryPolicyOrBuilder
        Returns:
        Whether the retryPriority field is set.
      • getRetryPriority

        public RetryPolicy.RetryPriority getRetryPriority()
         Specifies an implementation of a RetryPriority which is used to determine the
         distribution of load across priorities used for retries. Refer to
         :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
         
        .envoy.api.v2.route.RetryPolicy.RetryPriority retry_priority = 4;
        Specified by:
        getRetryPriority in interface RetryPolicyOrBuilder
        Returns:
        The retryPriority.
      • getRetryPriorityOrBuilder

        public RetryPolicy.RetryPriorityOrBuilder getRetryPriorityOrBuilder()
         Specifies an implementation of a RetryPriority which is used to determine the
         distribution of load across priorities used for retries. Refer to
         :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
         
        .envoy.api.v2.route.RetryPolicy.RetryPriority retry_priority = 4;
        Specified by:
        getRetryPriorityOrBuilder in interface RetryPolicyOrBuilder
      • getRetryHostPredicateList

        public List<RetryPolicy.RetryHostPredicate> getRetryHostPredicateList()
         Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
         for retries. If any of the predicates reject the host, host selection will be reattempted.
         Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
         details.
         
        repeated .envoy.api.v2.route.RetryPolicy.RetryHostPredicate retry_host_predicate = 5;
        Specified by:
        getRetryHostPredicateList in interface RetryPolicyOrBuilder
      • getRetryHostPredicateOrBuilderList

        public List<? extends RetryPolicy.RetryHostPredicateOrBuilder> getRetryHostPredicateOrBuilderList()
         Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
         for retries. If any of the predicates reject the host, host selection will be reattempted.
         Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
         details.
         
        repeated .envoy.api.v2.route.RetryPolicy.RetryHostPredicate retry_host_predicate = 5;
        Specified by:
        getRetryHostPredicateOrBuilderList in interface RetryPolicyOrBuilder
      • getRetryHostPredicateCount

        public int getRetryHostPredicateCount()
         Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
         for retries. If any of the predicates reject the host, host selection will be reattempted.
         Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
         details.
         
        repeated .envoy.api.v2.route.RetryPolicy.RetryHostPredicate retry_host_predicate = 5;
        Specified by:
        getRetryHostPredicateCount in interface RetryPolicyOrBuilder
      • getRetryHostPredicate

        public RetryPolicy.RetryHostPredicate getRetryHostPredicate​(int index)
         Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
         for retries. If any of the predicates reject the host, host selection will be reattempted.
         Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
         details.
         
        repeated .envoy.api.v2.route.RetryPolicy.RetryHostPredicate retry_host_predicate = 5;
        Specified by:
        getRetryHostPredicate in interface RetryPolicyOrBuilder
      • getRetryHostPredicateOrBuilder

        public RetryPolicy.RetryHostPredicateOrBuilder getRetryHostPredicateOrBuilder​(int index)
         Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
         for retries. If any of the predicates reject the host, host selection will be reattempted.
         Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
         details.
         
        repeated .envoy.api.v2.route.RetryPolicy.RetryHostPredicate retry_host_predicate = 5;
        Specified by:
        getRetryHostPredicateOrBuilder in interface RetryPolicyOrBuilder
      • getHostSelectionRetryMaxAttempts

        public long getHostSelectionRetryMaxAttempts()
         The maximum number of times host selection will be reattempted before giving up, at which
         point the host that was last selected will be routed to. If unspecified, this will default to
         retrying once.
         
        int64 host_selection_retry_max_attempts = 6;
        Specified by:
        getHostSelectionRetryMaxAttempts in interface RetryPolicyOrBuilder
        Returns:
        The hostSelectionRetryMaxAttempts.
      • getRetriableStatusCodesList

        public List<Integer> getRetriableStatusCodesList()
         HTTP status codes that should trigger a retry in addition to those specified by retry_on.
         
        repeated uint32 retriable_status_codes = 7;
        Specified by:
        getRetriableStatusCodesList in interface RetryPolicyOrBuilder
        Returns:
        A list containing the retriableStatusCodes.
      • getRetriableStatusCodesCount

        public int getRetriableStatusCodesCount()
         HTTP status codes that should trigger a retry in addition to those specified by retry_on.
         
        repeated uint32 retriable_status_codes = 7;
        Specified by:
        getRetriableStatusCodesCount in interface RetryPolicyOrBuilder
        Returns:
        The count of retriableStatusCodes.
      • getRetriableStatusCodes

        public int getRetriableStatusCodes​(int index)
         HTTP status codes that should trigger a retry in addition to those specified by retry_on.
         
        repeated uint32 retriable_status_codes = 7;
        Specified by:
        getRetriableStatusCodes in interface RetryPolicyOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The retriableStatusCodes at the given index.
      • hasRetryBackOff

        public boolean hasRetryBackOff()
         Specifies parameters that control retry back off. This parameter is optional, in which case the
         default base interval is 25 milliseconds or, if set, the current value of the
         `upstream.base_retry_backoff_ms` runtime parameter. The default maximum interval is 10 times
         the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
         describes Envoy's back-off algorithm.
         
        .envoy.api.v2.route.RetryPolicy.RetryBackOff retry_back_off = 8;
        Specified by:
        hasRetryBackOff in interface RetryPolicyOrBuilder
        Returns:
        Whether the retryBackOff field is set.
      • getRetryBackOff

        public RetryPolicy.RetryBackOff getRetryBackOff()
         Specifies parameters that control retry back off. This parameter is optional, in which case the
         default base interval is 25 milliseconds or, if set, the current value of the
         `upstream.base_retry_backoff_ms` runtime parameter. The default maximum interval is 10 times
         the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
         describes Envoy's back-off algorithm.
         
        .envoy.api.v2.route.RetryPolicy.RetryBackOff retry_back_off = 8;
        Specified by:
        getRetryBackOff in interface RetryPolicyOrBuilder
        Returns:
        The retryBackOff.
      • getRetryBackOffOrBuilder

        public RetryPolicy.RetryBackOffOrBuilder getRetryBackOffOrBuilder()
         Specifies parameters that control retry back off. This parameter is optional, in which case the
         default base interval is 25 milliseconds or, if set, the current value of the
         `upstream.base_retry_backoff_ms` runtime parameter. The default maximum interval is 10 times
         the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
         describes Envoy's back-off algorithm.
         
        .envoy.api.v2.route.RetryPolicy.RetryBackOff retry_back_off = 8;
        Specified by:
        getRetryBackOffOrBuilder in interface RetryPolicyOrBuilder
      • getRetriableHeadersList

        public List<HeaderMatcher> getRetriableHeadersList()
         HTTP response headers that trigger a retry if present in the response. A retry will be
         triggered if any of the header matches match the upstream response headers.
         The field is only consulted if 'retriable-headers' retry policy is active.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_headers = 9;
        Specified by:
        getRetriableHeadersList in interface RetryPolicyOrBuilder
      • getRetriableHeadersOrBuilderList

        public List<? extends HeaderMatcherOrBuilder> getRetriableHeadersOrBuilderList()
         HTTP response headers that trigger a retry if present in the response. A retry will be
         triggered if any of the header matches match the upstream response headers.
         The field is only consulted if 'retriable-headers' retry policy is active.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_headers = 9;
        Specified by:
        getRetriableHeadersOrBuilderList in interface RetryPolicyOrBuilder
      • getRetriableHeadersCount

        public int getRetriableHeadersCount()
         HTTP response headers that trigger a retry if present in the response. A retry will be
         triggered if any of the header matches match the upstream response headers.
         The field is only consulted if 'retriable-headers' retry policy is active.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_headers = 9;
        Specified by:
        getRetriableHeadersCount in interface RetryPolicyOrBuilder
      • getRetriableHeaders

        public HeaderMatcher getRetriableHeaders​(int index)
         HTTP response headers that trigger a retry if present in the response. A retry will be
         triggered if any of the header matches match the upstream response headers.
         The field is only consulted if 'retriable-headers' retry policy is active.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_headers = 9;
        Specified by:
        getRetriableHeaders in interface RetryPolicyOrBuilder
      • getRetriableHeadersOrBuilder

        public HeaderMatcherOrBuilder getRetriableHeadersOrBuilder​(int index)
         HTTP response headers that trigger a retry if present in the response. A retry will be
         triggered if any of the header matches match the upstream response headers.
         The field is only consulted if 'retriable-headers' retry policy is active.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_headers = 9;
        Specified by:
        getRetriableHeadersOrBuilder in interface RetryPolicyOrBuilder
      • getRetriableRequestHeadersCount

        public int getRetriableRequestHeadersCount()
         HTTP headers which must be present in the request for retries to be attempted.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_request_headers = 10;
        Specified by:
        getRetriableRequestHeadersCount in interface RetryPolicyOrBuilder
      • getRetriableRequestHeaders

        public HeaderMatcher getRetriableRequestHeaders​(int index)
         HTTP headers which must be present in the request for retries to be attempted.
         
        repeated .envoy.api.v2.route.HeaderMatcher retriable_request_headers = 10;
        Specified by:
        getRetriableRequestHeaders in interface RetryPolicyOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static RetryPolicy parseFrom​(ByteBuffer data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RetryPolicy parseFrom​(ByteBuffer data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RetryPolicy parseFrom​(com.google.protobuf.ByteString data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RetryPolicy 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 parseFrom​(byte[] data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RetryPolicy parseFrom​(byte[] data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RetryPolicy parseFrom​(com.google.protobuf.CodedInputStream input,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws IOException
        Throws:
        IOException
      • newBuilderForType

        public RetryPolicy.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public RetryPolicy.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected RetryPolicy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static RetryPolicy getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<RetryPolicy> parser()
      • getParserForType

        public com.google.protobuf.Parser<RetryPolicy> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public RetryPolicy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder