Method call()here needs to properly deal with CloseableHttpResponse.
It needs to make sure that:
Response content is fully consumed
This will allow the connection manager to safely re-use the connection. This is easily achievable by calling EntityUtils.consume(entity); before returning the data;
CloseableHttpResponse is actually closed, in order to ensure correct deallocation of system resources.
This MUST be called from a finally clause. So it would just a question of adding response.close(); in a finally block.
Method
call()
here needs to properly deal with CloseableHttpResponse.It needs to make sure that:
Response content is fully consumed This will allow the connection manager to safely re-use the connection. This is easily achievable by calling
EntityUtils.consume(entity);
before returning the data;CloseableHttpResponse is actually closed, in order to ensure correct deallocation of system resources. This MUST be called from a finally clause. So it would just a question of adding
response.close();
in a finally block.