Jersey client connection reuse with chunked gzip response #5855
apurv-goel
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to use a Jersey (3.x) client with ApacheConnector but I observed that in case a chunked gzip response is received. the connection gets closed as soon as the response is read. The connection is not reused even after configuring a connection pool, keep-alive strategy and reuse strategy.
The request seems to be aborted in the following code as it is chunked and because the connection was not yet released, it is shutdown.
jersey/connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectionClosingStrategy.java
Line 75 in b128e9c
However this seems to work correctly with non-gzipped chunked responses. Is Jersey not expected to work with gzip chunked responses? Or can I do something to make it work correctly here?
Reference Code:
I tried reading entity with InputStream.class instead of String.class as well but that also seems to produce the same result even if I close that InputStream. Also, seeing this issue with both Jersey 3 and Jersey 2 if that helps.
Beta Was this translation helpful? Give feedback.
All reactions