I am using Apache RequestConfig to configure some timeouts on my HttpClient .
RequestConfig config = RequestConfig.custom() .setConnectTimeout(timeout) .setSocketTimeout(timeout) .setConnectionRequestTimeout(timeout) // Can I leave this out.. .build(); CloseableHttpClient httpClient = HttpClients.custom() //.setConnectionManager(connectionManager) // ..if I don't use this .setDefaultRequestConfig(config) .build();
Does it make sense to call setConnectionRequestTimeout(timeout) even if I don't have a custom connection manager / pool manager?
As far as I understand, setConnectionRequestTimeout(timeout) used to set the connection timeout from the connection manager / pool.
Please note that I do not install the connection manager on the HttpClient (see comment).
source share