java.lang.Object
io.avaje.http.client.SimpleRetryHandler
- All Implemented Interfaces:
RetryHandler
Simple retry with max attempts and linear backoff.
-
Constructor Summary
ConstructorDescriptionSimpleRetryHandler
(int maxRetries, int backoffMillis) Create with maximum number of retries and linear backoff time and no gitter.SimpleRetryHandler
(int maxRetries, int backoffMillis, int gitterMillis) Create with maximum number of retries and linear backoff time. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isRetry
(int retryCount, HttpResponse<?> response) Return true if the request should be retried.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.avaje.http.client.RetryHandler
isExceptionRetry
-
Constructor Details
-
SimpleRetryHandler
public SimpleRetryHandler(int maxRetries, int backoffMillis, int gitterMillis) Create with maximum number of retries and linear backoff time.- Parameters:
maxRetries
- The maximum number of retry attemptsbackoffMillis
- The linear backoff between attempts in millisecondsgitterMillis
- The maximum amount of gitter that gets added to backoffMillis
-
SimpleRetryHandler
public SimpleRetryHandler(int maxRetries, int backoffMillis) Create with maximum number of retries and linear backoff time and no gitter.- Parameters:
maxRetries
- The maximum number of retry attemptsbackoffMillis
- The linear backoff between attempts in milliseconds
-
-
Method Details
-
isRetry
Description copied from interface:RetryHandler
Return true if the request should be retried.- Specified by:
isRetry
in interfaceRetryHandler
- Parameters:
retryCount
- The number of retry attempts already executedresponse
- The HTTP response- Returns:
- True if the request should be retried or false if not
-