3
我将我的REST
客户端模块从HttpClient.executeMethod(method)
改为RestTemplate.postForLocation(uri, obj)
。与HttpClient
,我会明确释放该方法的连接:RestTemplate是否会自动释放连接?
deleteMethod.releaseConnection();
我在Spring
RestTemplate
内找不到任何等价物。它会自动释放连接吗?我想,另一种方法是,在调用RestTemplate.postForLocation
之后不做任何事情是安全的吗?
这可能会回答你的问题,http://stackoverflow.com/questions/31869193/using-spring-rest-template-either-creating-too-many-connections-or-slow –