Set timeout on restful client

Posted by astan on 10-May-2012 23:39

Hi Guys,

I've created a restful client sonic connect service which times out with large data.

After it transmits the data, the server takes 5-10 minutes to process the request before sending a response. Our vendor is looking into that to see why it is taking so long.

There is no issue with smaller data.

We would still like to process the messages however, how can I increase the timeout?

Also, the large messages process correctly when I send them through a client I wrote which does not time out.

Thanks,

Arek.

All Replies

Posted by wtam on 11-May-2012 11:18

You can increase the HTTP client's receive timeout (in millisecond) by editing the config/spring.xml in the SC project.

Eg.

  "{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
    "300000"
 

namespace and schema location:

xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
      http://cxf.apache.org/schemas/configuration/http-conf.xsd


* Save changes in spring.xml
* Upload all to rebuild/upload the project archive
* Restart the container.

Thanks.

Also see:  http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html

Posted by astan on 13-May-2012 23:03

Hi William,

Thanks for your reply.

I modified the sonic.xml file as per your suggestion, saved and selectted to upload all, restarted the container but it still times out after 1 minute.


I have included the top few lines of my sonic.xml file below.

I'm not sure if the http-config:conduit name is being set correctly.

I am using the address which consumes the request.








 
     
         
       
 
   
     
       
     
   
 

I've also tried ReceiveTimeout with various non zero values to no avail.

Also, eclipse gives a warning on the http-conf:conduit line, the warning is,

Unable to locate Spring NamespaceHandler for element 'http-conf:conduit' of schema namespace 'http://cxf.apache.org/transports/http/configuration'

However, I suspect that is more to do with eclipse not being able to read the schema files correctly.

Thanks,

Arek.

Posted by wtam on 14-May-2012 21:17

Most likely, it is the conduit name not matching.  Experiment with the wildcard below which will match everything.

 

Check out the "Configuring an HTTP Conduit from Spring" secton on this page: http://cxf.apache.org/docs/jax-rs-client-api.html.  It talks about how possible ways to set conduit names.

This thread is closed