jersey
jersey copied to clipboard
Properly close the Apache response so that connections can be reused
Obsoletes https://github.com/jersey/jersey/pull/3565
OCA http://www.oracle.com/technetwork/community/oca-486395.html
See http://hc.apache.org/httpcomponents-client-4.5.x/tutorial/html/fundamentals.html#d5e145
In order to ensure proper release of system resources one must close either the content stream associated with the entity or the response itself The difference between closing the content stream and closing the response is that the former will attempt to keep the underlying connection alive by consuming the entity content while the latter immediately shuts down and discards the connection.