Skip to content

Commit

Permalink
Revert "make connection pool shared by default"
Browse files Browse the repository at this point in the history
  • Loading branch information
carlo-rtr committed Jul 22, 2015
1 parent 7ab73cd commit 1b710b7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 33 deletions.
37 changes: 18 additions & 19 deletions docs/source/manual/configuration.rst
Expand Up @@ -810,25 +810,24 @@ See HttpClientConfiguration_ for more options.
userAgent: <application name> (<client name>)
============================= ====================================== =============================================================================
Name Default Description
============================= ====================================== =============================================================================
timeout 500 milliseconds The maximum idle time for a connection, once established.
connectionTimeout 500 milliseconds The maximum time to wait for a connection to open.
connectionRequestTimeout 500 milliseconds The maximum time to wait for a connection to be returned from the connection pool.
timeToLive 1 hour The maximum time a pooled connection can stay idle (not leased to any thread)
before it is shut down.
cookiesEnabled false Whether or not to enable cookies.
shareConnectionManagerEnabled true Whether or not to share the connection manager.
maxConnections 1024 The maximum number of concurrent open connections.
maxConnectionsPerRoute 1024 The maximum number of concurrent open connections per route.
keepAlive 0 milliseconds The maximum time a connection will be kept alive before it is reconnected. If set
to 0, connections will be immediately closed after every request/response.
retries 0 The number of times to retry failed requests. Requests are only
retried if they throw an exception other than ``InterruptedIOException``,
``UnknownHostException``, ``ConnectException``, or ``SSLException``.
userAgent ``applicationName`` (``clientName``) The User-Agent to send with requests.
============================= ====================================== =============================================================================
========================= ====================================== =============================================================================
Name Default Description
========================= ====================================== =============================================================================
timeout 500 milliseconds The maximum idle time for a connection, once established.
connectionTimeout 500 milliseconds The maximum time to wait for a connection to open.
connectionRequestTimeout 500 milliseconds The maximum time to wait for a connection to be returned from the connection pool.
timeToLive 1 hour The maximum time a pooled connection can stay idle (not leased to any thread)
before it is shut down.
cookiesEnabled false Whether or not to enable cookies.
maxConnections 1024 The maximum number of concurrent open connections.
maxConnectionsPerRoute 1024 The maximum number of concurrent open connections per route.
keepAlive 0 milliseconds The maximum time a connection will be kept alive before it is reconnected. If set
to 0, connections will be immediately closed after every request/response.
retries 0 The number of times to retry failed requests. Requests are only
retried if they throw an exception other than ``InterruptedIOException``,
``UnknownHostException``, ``ConnectException``, or ``SSLException``.
userAgent ``applicationName`` (``clientName``) The User-Agent to send with requests.
========================= ====================================== =============================================================================


.. _man-configuration-clients-http-proxy:
Expand Down
Expand Up @@ -251,8 +251,7 @@ protected ConfiguredCloseableHttpClient createClient(
.setDefaultSocketConfig(socketConfig)
.setConnectionReuseStrategy(reuseStrategy)
.setRetryHandler(retryHandler)
.setUserAgent(createUserAgent(name))
.setConnectionManagerShared(configuration.isShareConnectionManagerEnabled());
.setUserAgent(createUserAgent(name));

if (keepAlive != 0) {
// either keep alive based on response header Keep-Alive,
Expand Down
Expand Up @@ -31,8 +31,6 @@ public class HttpClientConfiguration {

private boolean cookiesEnabled = false;

private boolean shareConnectionManagerEnabled = true;

@Min(1)
@Max(Integer.MAX_VALUE)
private int maxConnections = 1024;
Expand Down Expand Up @@ -164,14 +162,4 @@ public ProxyConfiguration getProxyConfiguration() {
public void setProxyConfiguration(ProxyConfiguration proxyConfiguration) {
this.proxyConfiguration = proxyConfiguration;
}

@JsonProperty
public boolean isShareConnectionManagerEnabled() {
return shareConnectionManagerEnabled;
}

@JsonProperty
public void setShareConnectionManagerEnabled(boolean shareConnectionManagerEnabled) {
this.shareConnectionManagerEnabled = shareConnectionManagerEnabled;
}
}

0 comments on commit 1b710b7

Please sign in to comment.