配置中增加关闭连接response.close()
This commit is contained in:
@@ -247,7 +247,7 @@ public class HttpClientUtil {
|
||||
* @param params 参数列表
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) {
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
// RequestContext requestContext = new RequestContext(req);
|
||||
|
||||
// CloseableHttpResponse response = null;
|
||||
@@ -296,7 +296,11 @@ public class HttpClientUtil {
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
||||
}
|
||||
}finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user