axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amila Suriarachchi <amilasuriarach...@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 Thu, 16 Sep 2010 04:51:38 GMT
On Wed, Sep 15, 2010 at 9:56 PM, Jarek Gawor <jgawor@gmail.com> wrote:

> 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.
>

No I think. This is the reason why you have to comment out the set method at
your first commit.
Axis2 is being used in Bpel servers and Mashup servers where it try to make
many connections with
back end hosts. Think about a scenario where you get 100s of connections for
a BPEL server.


>
> > 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.).
>

yes. But the idea of this commit is to fix the problem out of the box. Which
is still not the case.


>
> 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.


yes if we do this change at the early stages of Axis2. But currently lot of
people use it without using cleanUpTransport method. Even this is the
problem with Rampart and Sandesha. After 1.5.1 release I saw lot of people
report this issue due to same problem.

So this patch does not solve the problem out of the box for all cases. But
it break the code for some people.

thanks,
Amila.


> 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
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Mime
View raw message