axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarek Gawor <jga...@gmail.com>
Subject Re: svn commit: r992877 - in /axis/axis2/java/core/trunk: ./ modules/adb-codegen/test-resources/testsuite/ modules/adb-codegen/test/org/apache/axis2/schema/particlemaxoccurs/ modules/kernel/src/org/apache/axis2/jsr181/ modules/kernel/src/org/apache/a
Date Wed, 15 Sep 2010 16:26:23 GMT
On Wed, Sep 15, 2010 at 7:57 AM, Amila Suriarachchi
<amilasuriarachchi@gmail.com> wrote:
>
>> Modified:
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
>> URL:
>> http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=992877&r1=992876&r2=992877&view=diff
>>
>> ==============================================================================
>> ---
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
>> (original)
>> +++
>> axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
>> Sun Sep  5 19:38:56 2010
>> @@ -25,12 +25,13 @@ import org.apache.axiom.om.OMOutputForma
>>  import org.apache.axis2.AxisFault;
>>  import org.apache.axis2.Constants;
>>  import org.apache.axis2.context.MessageContext;
>> -import org.apache.axis2.context.ConfigurationContext;
>>  import org.apache.axis2.context.OperationContext;
>> +import org.apache.axis2.context.ConfigurationContext;
>>  import org.apache.axis2.description.TransportOutDescription;
>>  import org.apache.axis2.i18n.Messages;
>>  import org.apache.axis2.transport.MessageFormatter;
>>  import org.apache.axis2.transport.TransportUtils;
>> +import org.apache.axis2.util.JavaUtils;
>>  import org.apache.axis2.wsdl.WSDLConstants;
>>  import org.apache.commons.httpclient.Credentials;
>>  import org.apache.commons.httpclient.Header;
>> @@ -49,6 +50,8 @@ import org.apache.commons.httpclient.Use
>>  import org.apache.commons.httpclient.auth.AuthPolicy;
>>  import org.apache.commons.httpclient.auth.AuthScope;
>>  import org.apache.commons.httpclient.params.HttpMethodParams;
>> +import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
>> +import org.apache.commons.httpclient.params.HttpClientParams;
>>  import org.apache.commons.httpclient.protocol.Protocol;
>>  import org.apache.commons.logging.Log;
>>  import org.apache.commons.logging.LogFactory;
>> @@ -510,21 +513,16 @@ public abstract class AbstractHTTPSender
>>
>>  HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER);
>>                 if (connManager == null) {
>>                     log.trace("Making new ConnectionManager");
>> -                    connManager = new
>> MultiThreadedHttpConnectionManager();
>> -                    /*
>> -                     * Commented out for now as bugs in other parts of
>> Axis2 cause test failures when
>> -                     * proper connection reuse is enabled.
>> -                     */
>> -                    //
>> configContext.setProperty(HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER,
>> -                    //                           connManager);
>> -
>> +                    connManager = new
>> MultiThreadedHttpConnectionManager();
>> +
>>  configContext.setProperty(HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER,
>> +                                              connManager);
>>                 }
>
> -1 on this change.
>
> This tries to solve the problem by introducing another problem. Now since
> configuration context is set to use one MultiThreadedHttpConnectionManager
> it can only make two simultaneous connections for one host.

It's a change in behavior. Connection caching is now done by default
and by default MultiThreadedHttpConnectionManager limits the number of
connections in the pool for the same host to 2. That seems like a
reasonable default to me but we can always add an option to change it.

> If some one wants this behavior it can be easily done even with the earlier
> code by setting appropriate parameters.

I can argue the same with these changes. You can also set appropriate
parameter to pass your own HttpConnectionManager with custom settings
(e.g. pass SimpleHttpConnectionManager to effectively disable
connection reuse or pass MultiThreadedHttpConnectionManager with
higher maxConnectionsPerHost setting, etc.).

I think the real question you are raising is if connection reuse
should be done by default. I thought the answer to that question was
yes. If we agree on that then there is no reason for -1.

Jarek

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message