jersey icon indicating copy to clipboard operation
jersey copied to clipboard

Properly close the Apache response so that connections can be reused

Open agherardi opened this issue 7 years ago • 2 comments

agherardi avatar Jan 08 '18 19:01 agherardi

Obsoletes https://github.com/jersey/jersey/pull/3565

OCA http://www.oracle.com/technetwork/community/oca-486395.html

agherardi avatar Jan 08 '18 19:01 agherardi

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.

agherardi avatar Jan 08 '18 21:01 agherardi