try {
if (httpClient.getHttpConnectionManager() instanceof MultiThreadedHttpConnectionManager) {
MultiThreadedHttpConnectionManager connectionManager = (MultiThreadedHttpConnectionManager) httpClient
.getHttpConnectionManager();
connectionManager.closeIdleConnections(0); //shutdown do not empty connection pool
connectionManager.shutdown();
}
} catch (Exception x) {
logger.warn("Exception while closing sender", x);
}
}