The XmlApiClient is not threadsafe because the constructor calls this super-constructor:
protected ApiClient(ApiCommandProcessor<REQUEST> commandProcessor, ApiSession session) {
this(commandProcessor, new HttpClient(), session);
}
The problem here is, that new HttpClient() constructs a HttpClient with a SimpleHttpConnectionManager and this can cause an Exception and this log message:
WARN org.apache.commons.httpclient.SimpleHttpConnectionManager - SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
In my opinion the HttpClient which is used should be injected and build and configured elsewhere. Or it should be constructed with a MultiThreadedHttpConnectionManager.
But maybe the whole ApiClient is not meant to be threadsafe - that's why I'd like to discuss this issue before implementing a fix. What do you think?
The XmlApiClient is not threadsafe because the constructor calls this super-constructor:
The problem here is, that new HttpClient() constructs a HttpClient with a SimpleHttpConnectionManager and this can cause an Exception and this log message:
In my opinion the HttpClient which is used should be injected and build and configured elsewhere. Or it should be constructed with a MultiThreadedHttpConnectionManager.
But maybe the whole ApiClient is not meant to be threadsafe - that's why I'd like to discuss this issue before implementing a fix. What do you think?