We have a Java application that make use of urlfetch calling an external 
api. We are having issues with the request time. When we do a request in a 
local environment we have a mean time of 300ms, however in production we 
have times of 1s or 1.4s.

This is the code we are using:

        Calendar start = Calendar.getInstance();

    try {

          URLFetchService fetcher = URLFetchServiceFactory.getURLFetchService();

          URL url = new URL( String.format( API_URL, productsIds ) );
          Future<HTTPResponse> future = fetcher.fetchAsync(url);


          HTTPResponse responseHttp = future.get();
          byte[] content = responseHttp.getContent();

          response = new String(content);

          System.out.println("request time :" + 
(Calendar.getInstance().getTimeInMillis() - start.getTimeInMillis() ) );


    } catch ( Exception e ) {
        LOGGER.log( Level.SEVERE, "Error calling api : " + e.getMessage() );
    }


Is Google doing any kind of validation that produces this time increase?

Is there a way to reduce the request time?

Thank you very much








-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/16504e78-314c-4838-9b45-9aa89c30ae5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to