axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rees <>
Subject Re: Stubs & Options Configuration
Date Thu, 23 Apr 2009 02:12:50 GMT
On Wed, Apr 22, 2009 at 6:30 PM, David Rees <> wrote:
> OK, more reading and now I realize that keep-alive should be on by
> default, but to get any performance benefit, I also need to
> REUSE_HTTP_CLIENT.  So I've done that and yes, performance has
> improved now, but I run into the default limit of only 2 concurrent
> connections per host limit.
> How can I set my own MULTITHREAD_HTTP_CONNECTION_MANAGER or raise the
> default limit?  This is a custom application so I am not worried about
> exceeding RFC specifications for concurrent connections.

Talking to myself a bit more, but I finally figured out how to do it
with the help of this thread[1] on the axis-dev list.  The key is to
set both REUSE_HTTP_CLIENT to true and CACHED_HTTP_CLIENT to my own
HttpClient class.

Here's what I am doing is pseudo code:

Wrap the creation of new stubs in a function which then calls these functions:

Options o = stub._getServiceClient().getOptions();
o.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
o.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
o.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
o.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, getHttpClient());

getHttpClient creates a cached HttpClient with my own

MultiThreadedHttpConnectionManager manager = new
httpClient = new HttpClient(manager);

So far this appears to work well and significantly reduces response
time and improves performance when making a lot of requests in a row.

Would be nice if this were documented somewhere official, but at least
now it will be in the mail archives. :-)



View raw message