Closed
Description
Sylvain LAURENT opened SPR-13125 and commented
Same problem as #17144 but for HttpComponentsAsyncClientHttpRequestFactory : if I configure timeouts at the httpclient level but nothing in HttpComponentsAsyncClientHttpRequestFactory, then no timeout is applied.
In org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory.createAsyncRequest(URI, HttpMethod) one can see that RequestConfig.DEFAULT is set instead of leaving it as nul :
if (context.getAttribute(HttpClientContext.REQUEST_CONFIG) == null) {
// Use request configuration given by the user, when available
RequestConfig config = null;
if (httpRequest instanceof Configurable) {
config = ((Configurable) httpRequest).getConfig();
}
if (config == null) {
config = RequestConfig.DEFAULT;
}
context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
}
Affects: 4.1.6
Issue Links:
- Configured RequestConfig in HttpClient gets overwritten by default [SPR-12540] #17144 Configured RequestConfig in HttpClient gets overwritten by default
- Defensively access deprecated AbstractHttpClient class from Apache HttpComponents [SPR-14422] #18993 Defensively access deprecated AbstractHttpClient class from Apache HttpComponents