2016-09-30 3333 views
3

我将我的REST客户端模块从HttpClient.executeMethod(method)改为RestTemplate.postForLocation(uri, obj)。与HttpClient,我会明确释放该方法的连接:RestTemplate是否会自动释放连接?

deleteMethod.releaseConnection();

我在SpringRestTemplate内找不到任何等价物。它会自动释放连接吗?我想,另一种方法是,在调用RestTemplate.postForLocation之后不做任何事情是安全的吗?

+2

这可能会回答你的问题,http://stackoverflow.com/questions/31869193/using-spring-rest-template-either-creating-too-many-connections-or-slow –

回答