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 }}
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
I'm having some problems when I try to send messages in a multi-thread scenario (with the same httpclient instance, using PoolingHttpClientConnectionManager).
After the message is sent in MandrillRESTRequest, the connections aren't closed; when the app reaches the max conn set in httpclient, the messages get blocked and aren't sent.
I fixed it making a copy of MandrillRESTRequest in my working directory and converting HttpClient to CloseableHttpClient (httpclient 4.3.1) and HttpResponse to CloseableHttpResponse, to be able to do this modification:
No, I haven't looked at it since mettini never replied. If you replicate the suggested changes, test it, and issue a pull I'll merge it and re-publish the jar in Sonatype.
Hi,
I'm having some problems when I try to send messages in a multi-thread scenario (with the same httpclient instance, using PoolingHttpClientConnectionManager).
After the message is sent in MandrillRESTRequest, the connections aren't closed; when the app reaches the max conn set in httpclient, the messages get blocked and aren't sent.
I fixed it making a copy of MandrillRESTRequest in my working directory and converting HttpClient to CloseableHttpClient (httpclient 4.3.1) and HttpResponse to CloseableHttpResponse, to be able to do this modification:
try {
entity = response.getEntity();
} finally {
response.close();
}
BufferedReader br = new BufferedReader(new InputStreamReader((entity.getContent())));
(this recommendation of closing the connection in a multi-thread environment is detailed here: http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e392).
Maybe there's a way to do this connection close without modifying method signature.
The text was updated successfully, but these errors were encountered: