Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release CloseableHttpResponse #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Release CloseableHttpResponse #3

wants to merge 1 commit into from

Conversation

laszlohordos
Copy link

I'm using CloseableHttpResponse in httpclient-4.3 and I didn't find any other way to release the connection back to the pool. The default implementation close the DefaultHttpClient but I don't use that class.

I'm using CloseableHttpResponse in 4.3 and I didn't find any other way
to release the connection back to the pool. The default implementation
close the DefaultHttpClient but I don't use that class.
@m-van-tilburg
Copy link

@laszlohordos Looking at (currently) the only implementation of CloseableHttpResponse, namely org.apache.http.impl.execchain.HttpResponseProxy calling close() will not release the connection back to the pool but it will close the connection. To release the connection back the pool you can use org.apache.http.util.EntityUtils.consume(super.res.getEntity()). The connections in the connection pool will be closed when the PoolingHttpClientConnectionManager is closed/shutdown.

@mibo mibo added this to the 5.0.0 milestone Oct 15, 2023
@mibo mibo added the bug label Oct 15, 2023
@mibo mibo self-assigned this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants