I have to create RedisTemplate for each of the requests (write/read) on demand. The connectionfactory is JedisConnectionFactory
JedisConnectionFactory factory=new
JedisConnectionFactory(RedisSentinelConfiguration,JedisPoolConfig);
Once, I do operations with RedisTemplate.opsForHash/opsForValue, how to dispose the templates safely , so that the connection is returned to JedisPool.
As of now , I do this with
template.getConnectionFactory().getConnection().close();
Is this the right way ?