Hi Afkham,
Thanks for your response.

With your approach is it possible to use/set socket timeout to be 
different for different service invocations?  Can it be removed out of the 
getConfigurationContext and put/set it right before the actual call to the 
web service?

Best Regards,
-Himakar
----------------------------------------------------
Himakar Chennapragada
IMS e-Business, SOA Development
IBM Silicon Valley Lab, San Jose, CA
Phone: 408-463-4758, Tie Line: 543-4758
Email: [email protected]
----------------------------------------------------




From:
Afkham Azeez <[email protected]>
To:
[email protected]
Date:
07/17/2011 08:42 PM
Subject:
Re: Axis2 timeout issue



When creating the client configuration context. Create it as follows.

private ConfigurationContext getClientConfigurationContext() throws 
AxisFault {
        String clientRepositoryLocation =
                serverConfig.getFirstProperty(CLIENT_REPOSITORY_LOCATION);
        String clientAxis2XmlLocationn = 
serverConfig.getFirstProperty(CLIENT_AXIS2_XML_LOCATION);
        ConfigurationContext clientConfigContext =
                
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                        clientRepositoryLocation, 
clientAxis2XmlLocationn);
        MultiThreadedHttpConnectionManager httpConnectionManager = new 
MultiThreadedHttpConnectionManager();
        HttpConnectionManagerParams params = new 
HttpConnectionManagerParams();

        // Set the default max connections per host
        int defaultMaxConnPerHost = 500;
        Parameter defaultMaxConnPerHostParam =
            
clientConfigContext.getAxisConfiguration().getParameter("defaultMaxConnPerHost");
        if(defaultMaxConnPerHostParam != null){
            defaultMaxConnPerHost = 
Integer.parseInt((String)defaultMaxConnPerHostParam.getValue());
        }
        params.setDefaultMaxConnectionsPerHost(defaultMaxConnPerHost);

        // Set the max total connections
        int maxTotalConnections = 15000;
        Parameter maxTotalConnectionsParam =
            
clientConfigContext.getAxisConfiguration().getParameter("maxTotalConnections");
        if(maxTotalConnectionsParam != null){
            maxTotalConnections = 
Integer.parseInt((String)maxTotalConnectionsParam.getValue());
        }
        params.setMaxTotalConnections(maxTotalConnections);

        params.setSoTimeout(600000);
        params.setConnectionTimeout(600000);

        httpConnectionManager.setParams(params);
        
clientConfigContext.setProperty(HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER,
                                        httpConnectionManager);
        registerHouseKeepingTask(clientConfigContext);
        clientConfigContext.setProperty(ServerConstants.WORK_DIR, 
serverWorkDir);
        return clientConfigContext;
    }

On Fri, Jul 15, 2011 at 12:13 PM, Himakar Chennapragada <
[email protected]> wrote:

changing the subject to better describe the content/issue. 

Best Regards,
-Himakar
----------------------------------------------------
Himakar Chennapragada
IMS e-Business, SOA Development
IBM Silicon Valley Lab, San Jose, CA
Phone: 408-463-4758, Tie Line: 543-4758
Email: [email protected]
----------------------------------------------------

----- Forwarded by Himakar Chennapragada/Silicon Valley/IBM on 07/14/2011 
11:41 PM ----- 
From: 
Himakar Chennapragada/Silicon Valley/IBM 
To: 
[email protected] 
Date: 
07/14/2011 11:40 PM 
Subject: 
Axis2 question



Hi, 
We have an Axis2 timeout issue that we are trying to resolve and need your 
urgent help.  Any input/comments are highly appreciated.  Thanks! 

----------------------------------------------------------------------------------------------------------------------------------------
 

Here is some background information and questions: 

We have multiple threads calling out to same or different web services. 
 We use a new ServiceClient for each invocation to an external web service 
(same or different service) with the REUSE_HTTP_CLIENT option; each 
invocation has its own set of "Options" as well.  We do that partly 
because the threads doing the invocations can invoke many different web 
services (not just one) and I am sure there is room for improvement in 
that area (see my second question below). 

We use Axis2 v1.4.1. 

Here are my questions: 
1.  We had a timeout issue where the timeout is not being honored properly 
and I put in a patch (see patch details below) and it still does not 
work/honored for larger workloads; for very small workloads it is fine 
tho.  I put in a patch to set timeout for each invocation but it still 
didn't help.  I could see that the new timeout values are being set 
properly (after I applied the patch) in the "options" but no luck.  Any 
idea why the timeouts are not still honored even after applying the patch? 
 (my guess is due to the way we use a new ServiceClient with the HTTP 
REUSE option but I could be wrong). 

Patch details: 
The patch is applied to 
org.apache.axis2.transport.http.AbstractHTTPSender.class 
http://web.archiveorange.com/archive/v/R4VLPPfrNvyJ4cJFywD8 
https://issues.apache.org/jira/browse/AXIS2-3160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 


2. Also wondering if it is a good idea to use only one ServiceClient for 
different services? 

Best Regards,
-Himakar
----------------------------------------------------
Himakar Chennapragada
IMS e-Business, SOA Development
IBM Silicon Valley Lab, San Jose, CA
Phone: 408-463-4758, Tie Line: 543-4758
Email: [email protected]
----------------------------------------------------









-- 
Afkham Azeez
Director of Architecture; WSO2, Inc.; http://wso2.com, 
Member; Apache Software Foundation; http://www.apache.org/

email: [email protected] cell: +94 77 3320919
blog: http://blog.afkham.org
twitter: http://twitter.com/afkham_azeez
linked-in: http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware



Reply via email to