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: Axis2 1.5.1 and the default HttpClient reuse
Date Wed, 19 Aug 2009 15:33:27 GMT
hi Glen,

A quick question, will go through this change properly tomorrow.

Lets say I want to invoke a service using service client with multiple
threads as follows,

Thread Class.

public class InvokeService implements Runnable{

    private ConfigurationContext configurationContext = null;

    public InvokeService(ConfigurationContext configurationContext) {
        this.configurationContext = configurationContext;
    }

    public void run() {
        try {
            ServiceClient serviceClient = new
ServiceClient(configurationContext,null);
            serviceClient.setTargetEPR(new EndpointReference("
http://localhost:8088/axis2/services/Version"));
            serviceClient.getOptions().setAction("urn:getVersion");
            OMElement omElement = serviceClient.sendReceive(null);
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
    }
}

Invocation class

try {
            ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,null);
            for (int i=1;i<5;i++){
                InvokeService invokeService = new
InvokeService(configurationContext);
                Thread thread = new Thread(invokeService);
                thread.start();
            }
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }

1. In this case with your new change how many
MultiThreadedHttpConnectionManager
instances created?

2. In your test case you have use  options.setCallTransportCleanup(true); is
this manadatory?

As you know this builds the OMElement before returning the response. Which
is not what every one needs.

thanks,
Amila.





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

Mime
View raw message