Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl.classic

public Class HttpRequestRetryExec

extends Object
implements ExecChainHandler
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.classic.ExecChainHandler
Annotations
@Contract
threading:STATELESS
@Internal
Imports
java.io.IOException, .InterruptedIOException, org.apache.hc.client5.http.HttpRequestRetryStrategy, .HttpRoute, org.apache.hc.client5.http.classic.ExecChain, .ExecChain.Scope, .ExecChainHandler, org.apache.hc.client5.http.config.RequestConfig, org.apache.hc.client5.http.impl.ChainElement, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.annotation.Contract, .Internal, .ThreadingBehavior, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .HttpEntity, .HttpException, .NoHttpResponseException, org.apache.hc.core5.http.io.support.ClassicRequestBuilder, org.apache.hc.core5.util.Args, .TimeValue, .Timeout, org.slf4j.Logger, .LoggerFactory

Request executor in the request execution chain that is responsible for making a decision whether a request that failed due to an I/O exception or received a specific response from the target server should be re-executed.

Further responsibilities such as communication with the opposite endpoint is delegated to the next executor in the request execution chain.

If this handler is active, pay particular attention to the placement of other handlers within the handler chain relative to the retry handler. Use ChainElement#RETRY as name when referring to this handler.

If a custom handler is placed before the retry handler, the handler will see the initial request and the final outcome after the last retry. Elapsed time will account for any delays imposed by the retry handler.

A custom handler which is placed after the retry handler will be invoked for each individual retry. Elapsed time will measure each individual http request, without the delay imposed by the retry handler.

Since
5.0

Field Summary

Modifier and TypeField and Description
private static final Logger
private final HttpRequestRetryStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ClassicHttpResponse
execute(final ClassicHttpRequest
the actual request.
request
,
final ExecChain.Scope
the execution scope .
scope
,
final ExecChain
the next element in the request execution chain.
chain
)

Implements org.apache.hc.client5.http.classic.ExecChainHandler.execute.

Executes the actual HTTP request.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
retryStrategyback to summary
private final HttpRequestRetryStrategy retryStrategy

Constructor Detail

HttpRequestRetryExecback to summary
public HttpRequestRetryExec(final HttpRequestRetryStrategy retryStrategy)

Method Detail

executeback to summary
public ClassicHttpResponse execute(final ClassicHttpRequest request, final ExecChain.Scope scope, final ExecChain chain) throws IOException, HttpException

Implements org.apache.hc.client5.http.classic.ExecChainHandler.execute.

Doc from org.apache.hc.client5.http.classic.ExecChainHandler.execute.

Executes the actual HTTP request. The handler can choose to return a response message or delegate request execution to the next element in the execution chain.

Parameters
request:ClassicHttpRequest

the actual request.

scope:ExecChain.Scope

the execution scope .

chain:ExecChain

the next element in the request execution chain.

Annotations
@Override