Package com.helixframework.okhttp.retry
Class RetryInterceptor
java.lang.Object
com.helixframework.okhttp.retry.RetryInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
OkHttp interceptor that retries failed requests with exponential backoff and jitter.
The interceptor will automatically retry http requests that result in 50x responses and can be configured to retry under different scenarios using the `retryOn` method of the builder.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating new instances ofRetryInterceptor.Nested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTag that can be added to a request to prevent the request from being retried in the event of a failure.Fields inherited from interface okhttp3.Interceptor
Companion -
Method Summary
Modifier and TypeMethodDescriptionstatic RetryInterceptor.Builderbuilder()Creates a builder forRetryInterceptor.okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain) static RetryInterceptorstandard()Creates an instance ofRetryInterceptorwith the standard default configuration.
-
Field Details
-
TAG_NORETRY
Tag that can be added to a request to prevent the request from being retried in the event of a failure.- See Also:
-
-
Method Details
-
builder
Creates a builder forRetryInterceptor.- Returns:
- a
RetryInterceptor.Builder
-
standard
Creates an instance ofRetryInterceptorwith the standard default configuration.- Returns:
- a
RetryInterceptor
-
intercept
@NotNull public okhttp3.Response intercept(@NotNull okhttp3.Interceptor.Chain chain) throws IOException - Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-