Hi Roland 

>What are the limits for max connections and connections per host on the
manager?

I have set it to 200 total + 50 per host (there are only 2 possible
hosts)

> In the code that posts the soap message to the secure server: -
> 
> - get an instance of the HttpClient

>"an instance"? You mean "the instance", right? Otherwise there is
something wrong with your singleton implementation :-)

Yup, *the* instance indeed :).  I have the following code: -


public class HttpClientSingleton {
        
        private static HttpClient client = null;
        
        public static HttpClient getInstance(){
                
                if (null == client){
                        MultiThreadedHttpConnectionManager
connectionManager = new MultiThreadedHttpConnectionManager();
        
connectionManager.getParams().setMaxConnectionsPerHost(HostConfiguration
.ANY_HOST_CONFIGURATION, 50);
        
connectionManager.getParams().setMaxTotalConnections(200);
                client = new HttpClient(connectionManager);
                }
                
                return client;
        }
}

Does that look sensible?

I call HttpClientSingleton.getInstance() in the code that makes the
actual SSL call.


>> - create the PostMethod
>> - use post.setRequestEntity to set the Soap message to be sent
>> - set timeouts on the connection manager

> What for? If you want timeouts to take effect for the method
execution, set them in the method params. If you want the same timeouts
for all method 
> executions, set them in the default params for the HttpClient. See the
preferences guide:
> http://jakarta.apache.org/commons/httpclient/preference-api.html

Yeah, I was intending to change that, it's likely to be the same timeout
for all connections, but I thought I would mention it in case it rang
some alarm-bells for someone indicating that it was the problem.


>> - execute the Post Method
>> - get the response body
>>
>> In the finally I do a post.releaseConnection();

>releaseConnection will give the connection back to the pool, but does
not close it. Anyway, the number of connections is limited by the pool,
so that 
>should not be a problem.

Yup, my thoughts exactly - I assumed that the
MultiThreadedHttpConnectionManager would handle that and not let it grow
above the 200 total



> Are there any known problems with your SSL implementation?
> Some of them are broken pretty badly, I have heard.

I am using Apache Client for the SSL / https, is it possible to use a
different implementation of SSL in the client itself?

>Are you sure that there is no file handle leak somewhere else in your
code?

Always a possibility, but the other code that is used (non-proxy stuff)
has been used on live successfully for 6 months or so.  I'm not sure how
to properly debug this stuff to be honest.

Thanks for your help and the quick reply.

All the best,
Ash

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to