skip to Main Content

Redis – Should I always call close of jedis instance at the end of business logic?

I`m using jedis as the with spring boot for redis connection. The jedis pool is configured as follow: @Configuration @ConditionalOnClass(JedisPool.class) @EnableConfigurationProperties(JedisProperties.class) public class JedisAutoConfiguration { private JedisProperties jedisProperties; public JedisAutoConfiguration(JedisProperties jedisProperties) { this.jedisProperties = jedisProperties; } @Bean @ConditionalOnMissingBean(JedisPool.class) public JedisPool…

VIEW QUESTION

RedisTemplate mock is only working in the test class

Class A{ @Autowired private RedisTemplate<String, Object> redisTemplate; private String readFromCache(String bucket, String key) { Object object = redisTemplate.opsForHash().get(bucketName, key); System.out.println("----" + redisTemplate.opsForHash().get("1", "1")); String returnValue = ""; if (Objects.nonNull(object)) returnValue = object.toString(); return returnValue; } } Class B Class B…

VIEW QUESTION
Back To Top
Search