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
Future<HTTPResponse> future = fetcher.fetchAsync(url);
HTTPResponse responseHttp = future.get();
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/3447916e-079b-4186-be6a-7a84fa99f1ea%40googlegroups.com.--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/ryYsvyEily4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.