I am getting error while trying to returnResources from the jedis pool.The code are as follow.
Jedis publisherJedis = jedispool.getResource();
if(!redisPassword.equals(""))
publisherJedis.auth(redisPassword);
publisherJedis.publish(channel,data);
log.debug("Publisher jedis is connected: " + publisherJedis.isConnected());
log.debug("Jsondata is added into the queue " + data);
try {
jedispool.returnResource(publisherJedis);
jedispool.destroy();
publisherJedis.close();
} catch (Exception e) {
e.printStackTrace();
log.error("Exception occured in returing resource " + e);
}