You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No support of persistent HTTP connections within org.springframework.http.client.SimpleClientHttpRequestFactory (v3.0.4) [SPR-7990] #12645
in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
I've found that Spring's org.springframework.http.client.SimpleClientHttpRequestFactory (at least version 3.0.4) does not support persistent HTTP connections. Applying it with RestTemplate yields creation of a lot of HTTP connections (up to some 10000s) under medium load.
WireShark shows that each connection is closed by the client immediately after response has been handled. This happens even if you configure your VM according to the recommendations from here:
As you mentioned, the SimpleClientHttpRequestFactory simply relies on java.net.HttpURLConnection, which should support persistent connection by default (the "http.keepalive" setting is enabled by default in the JVM).
For more specific use cases, other implementations should be used, like the one based on HttpComponents.
in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
Activity
spring-projects-issues commentedon Sep 19, 2014
Brian Clozel commented
As you mentioned, the SimpleClientHttpRequestFactory simply relies on java.net.HttpURLConnection, which should support persistent connection by default (the "http.keepalive" setting is enabled by default in the JVM).
For more specific use cases, other implementations should be used, like the one based on HttpComponents.