Interface HttpRetryPolicy.Builder

All Superinterfaces:
Buildable, CopyableBuilder<HttpRetryPolicy.Builder,HttpRetryPolicy>, SdkBuilder<HttpRetryPolicy.Builder,HttpRetryPolicy>, SdkPojo
Enclosing class:
HttpRetryPolicy

public static interface HttpRetryPolicy.Builder extends SdkPojo, CopyableBuilder<HttpRetryPolicy.Builder,HttpRetryPolicy>
  • Method Details

    • httpRetryEvents

      HttpRetryPolicy.Builder httpRetryEvents(Collection<String> httpRetryEvents)

      Specify at least one of the following values.

      • server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511

      • gateway-error – HTTP status codes 502, 503, and 504

      • client-error – HTTP status code 409

      • stream-error – Retry on refused stream

      Parameters:
      httpRetryEvents - Specify at least one of the following values.

      • server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511

      • gateway-error – HTTP status codes 502, 503, and 504

      • client-error – HTTP status code 409

      • stream-error – Retry on refused stream

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • httpRetryEvents

      HttpRetryPolicy.Builder httpRetryEvents(String... httpRetryEvents)

      Specify at least one of the following values.

      • server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511

      • gateway-error – HTTP status codes 502, 503, and 504

      • client-error – HTTP status code 409

      • stream-error – Retry on refused stream

      Parameters:
      httpRetryEvents - Specify at least one of the following values.

      • server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511

      • gateway-error – HTTP status codes 502, 503, and 504

      • client-error – HTTP status code 409

      • stream-error – Retry on refused stream

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • maxRetries

      HttpRetryPolicy.Builder maxRetries(Long maxRetries)

      The maximum number of retry attempts.

      Parameters:
      maxRetries - The maximum number of retry attempts.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • perRetryTimeout

      HttpRetryPolicy.Builder perRetryTimeout(Duration perRetryTimeout)

      The timeout for each retry attempt.

      Parameters:
      perRetryTimeout - The timeout for each retry attempt.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • perRetryTimeout

      default HttpRetryPolicy.Builder perRetryTimeout(Consumer<Duration.Builder> perRetryTimeout)

      The timeout for each retry attempt.

      This is a convenience method that creates an instance of the Duration.Builder avoiding the need to create one manually via Duration.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to perRetryTimeout(Duration).

      Parameters:
      perRetryTimeout - a consumer that will call methods on Duration.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • tcpRetryEventsWithStrings

      HttpRetryPolicy.Builder tcpRetryEventsWithStrings(Collection<String> tcpRetryEvents)

      Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.

      Parameters:
      tcpRetryEvents - Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tcpRetryEventsWithStrings

      HttpRetryPolicy.Builder tcpRetryEventsWithStrings(String... tcpRetryEvents)

      Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.

      Parameters:
      tcpRetryEvents - Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tcpRetryEvents

      HttpRetryPolicy.Builder tcpRetryEvents(Collection<TcpRetryPolicyEvent> tcpRetryEvents)

      Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.

      Parameters:
      tcpRetryEvents - Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tcpRetryEvents

      HttpRetryPolicy.Builder tcpRetryEvents(TcpRetryPolicyEvent... tcpRetryEvents)

      Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.

      Parameters:
      tcpRetryEvents - Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
      Returns:
      Returns a reference to this object so that method calls can be chained together.