Properly closing the connections in the pool when there are issues with any connection
malinthaprasan opened this issue · comments
Description:
The code in [1] only clears the map which holds JMS connections when there are any issues with connections. We need to close individual connections as well. Otherwise, those connections will be kept as it is at the JMS server side and consume resources.
/**
* Clear the shared connection map due to stale connections
*/
private synchronized void clearSharedConnections() {
sharedConnectionMap.clear();
lastReturnedConnectionIndex = 0;
}