diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java index 1e488267d..4e9a7379b 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java @@ -184,6 +184,9 @@ abstract class InternalAbstractHttpAsyncClient extends AbstractHttpAsyncClientBa if (requestConfig != null) { clientContext.setRequestConfig(requestConfig); } + + setupContext(clientContext); + final HttpRoute route = determineRoute( httpHost != null ? httpHost : RoutingSupport.determineHost(request), clientContext); @@ -194,8 +197,6 @@ abstract class InternalAbstractHttpAsyncClient extends AbstractHttpAsyncClientBa } final AsyncExecRuntime execRuntime = createAsyncExecRuntime(pushHandlerFactory); - setupContext(clientContext); - final AsyncExecChain.Scheduler scheduler = this::executeScheduled; final AsyncExecChain.Scope scope = new AsyncExecChain.Scope(exchangeId, route, request, future,