Class SimpleRetryHandler

java.lang.Object
io.avaje.http.client.SimpleRetryHandler
All Implemented Interfaces:
RetryHandler

public class SimpleRetryHandler
extends Object
implements RetryHandler
Simple retry with max attempts and linear backoff.
  • Constructor Details

    • SimpleRetryHandler

      public SimpleRetryHandler​(int maxRetries, long backoffMillis)
  • Method Details

    • isRetry

      public boolean isRetry​(int retryCount, HttpResponse<?> response)
      Description copied from interface: RetryHandler
      Return true if the request should be retried.
      Specified by:
      isRetry in interface RetryHandler
      Parameters:
      retryCount - The number of retry attempts already executed
      response - The HTTP response
      Returns:
      True if the request should be retried or false if not