java.lang.Object
io.avaje.http.client.SimpleRetryHandler
- All Implemented Interfaces:
RetryHandler
Simple retry with max attempts and linear backoff.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleRetryHandler(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 TypeMethodDescriptionbooleanisRetry(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, waitMethods 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:RetryHandlerReturn true if the request should be retried.- Specified by:
isRetryin 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
-