Class SimpleRetryHandler

  • All Implemented Interfaces:
    RetryHandler

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

      • SimpleRetryHandler

        public SimpleRetryHandler​(int maxRetries,
                                  long backoffMillis)
        Create with maximum number of retries and linear backoff time.
        Parameters:
        maxRetries - The maximum number of retry attempts
        backoffMillis - The linear backoff between attempts in milliseconds
    • Method Detail

      • 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