Arvind
Arvind

Reputation: 6474

using xml rpc client in google app engine for java- is the timeout at 30s?- how to access using low level API

I am trying to use an XML RPC client in a java web app on Google App Engine, to retrieve some data... The thing is, the fetch may take longer than 30s which is the timeout limit for java.net in Google App Engine for Java.

So I have 3 questions--

(1) Am I correct in assuming that the timeout limit for XML RPC Client (eg Apache XML RPC Client) is same as the timeout limit for java.net=30s ?

(2) If I am correct in my assumption, then is there some way to manually set the timeout limit before the XML RPC client actually makes the call? As I understand the timeout limit can be manually set using the low level API, when using Java.net... But I dont know how to apply the low level API to Apache XML RPC Client...

(3) If what I am asking cannot be done with Apache's XML RPC Client, then can you suggest some alternative XML RPC client?

Regards, Arvind.

Upvotes: 1

Views: 326

Answers (1)

fmatheis
fmatheis

Reputation: 251

The limit is the one given by Google App Engine on UrlFetch (5 seconds by default).

In case you want to change it (i.e. to 60 seconds) you can do something like this:

XmlRpcClient client = new XmlRpcClient()
client.setTransportFactory(new XmlRpcTransportFactory(){

        @Override
        public XmlRpcTransport getTransport() {

            return new XmlRpcSunHttpTransport(client){
                protected java.net.URLConnection getURLConnection(){
                    URLConnection urlConnection = super.getURLConnection();
                    urlConnection.setConnectTimeout(60000);
                    urlConnection.setReadTimeout(60000);
                    return urlConnection;
                }
            };

        }});

Upvotes: 1

Related Questions