0
有一个Java应用程序,该应用程序对执行某些sql查询的ruby应用程序进行http调用,并且如果成功,则返回http响应200到java应用程序,我的问题是ruby应用程序需要花费5分钟以上才能完成执行,同时在接近3分钟后检查java应用程序的日志,并将其作为网关超时异常。如何解决此问题?如何通过增加http响应时间来避免网关超时异常
的Java HTTP调用Ruby应用程序:
GetMethod get = new GetMethod(URL to ruby application);
Exception exception = null;
try {
// Get HTTP client
HttpClient httpclient = new HttpClient();
int resultCode = httpclient.executeMethod(get);
// Display status code
if (log.isInfoEnabled()) {
log.info("response status code: "
+ resultCode);
// Display response
log.info("Response body: " + get.getResponseBodyAsString());
}
if (resultCode != 200) {
log.error("Failed with status code: "
+ resultCode);
log.error("Response body: " + get.getResponseBodyAsString());
}
}