Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Thursday, October 24, 2013

Setting a timeout on an Apache CXF webservice call

In this short post, I'll provide the code for setting a timeout on a webservice call. The client has been generated by Apache CXF 2.6.1, and the webservice is accessed by an HTTP call.

Client client = ClientProxy.getClient(yourPortType);

HTTPConduit httpConduit = (HTTPConduit) client.getConduit();

HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(5000);
httpClientPolicy.setReceiveTimeout(5000);

httpConduit.setClient(httpClientPolicy);

You should add this chunk of code before you call the method on yourPortType. The connectionTimeout is how long it may take to connect to the service, the receiveTimeout is how long it may take for the webservice to respond.


Thursday, April 19, 2012

Make the web faster using SPDY

Google Developers has announced they have launched a version of mod_spdy, an Apache mod that adds SPDY support to your Apache HTTPD server. To get started, download mod_spdy and follow the install guidelines.

By default, Chrome, Chrome for Android and the most recent versions of Firefox support the SPDY protocol. It's not likely Microsoft's Internet Explorer will support SPDY in the near future.