public final class RetryingHttpClient extends RetryingClient<HttpRequest,HttpResponse>
Client
decorator that handles failures of an invocation and retries HTTP requests.Modifier and Type | Method and Description |
---|---|
protected HttpResponse |
doExecute(ClientRequestContext ctx,
HttpRequest req)
Invoked by
RetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> |
newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy)
Creates a new
Client decorator that handles failures of an invocation and retries HTTP requests. |
static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> |
newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy,
int defaultMaxAttempts)
Creates a new
Client decorator that handles failures of an invocation and retries HTTP requests. |
static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> |
newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy,
int defaultMaxAttempts,
long responseTimeoutMillisForEachAttempt)
Creates a new
Client decorator that handles failures of an invocation and retries HTTP requests. |
execute, getNextDelay, getNextDelay, retryStrategy, setResponseTimeout
delegate, toString
public static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy)
Client
decorator that handles failures of an invocation and retries HTTP requests.retryStrategy
- the retry strategypublic static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy, int defaultMaxAttempts)
Client
decorator that handles failures of an invocation and retries HTTP requests.retryStrategy
- the retry strategydefaultMaxAttempts
- the default number of max attempts for retrypublic static Function<Client<HttpRequest,HttpResponse>,RetryingHttpClient> newDecorator(RetryStrategy<HttpRequest,HttpResponse> retryStrategy, int defaultMaxAttempts, long responseTimeoutMillisForEachAttempt)
Client
decorator that handles failures of an invocation and retries HTTP requests.retryStrategy
- the retry strategydefaultMaxAttempts
- the default number of max attempts for retryresponseTimeoutMillisForEachAttempt
- response timeout for each attempt. 0
disables
the timeoutprotected HttpResponse doExecute(ClientRequestContext ctx, HttpRequest req) throws Exception
RetryingClient
RetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set.doExecute
in class RetryingClient<HttpRequest,HttpResponse>
Exception
© Copyright 2015–2017 LINE Corporation. All rights reserved.