lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

Redis cluster using lettuce sometimes get command slow

Open zlp1992 opened this issue 1 year ago • 3 comments

I'm using spring-data-redis and lettuce in redis cluster. here is the code:

    @Bean
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
        template.setConnectionFactory(factory);
        template.setKeySerializer(RedisSerializer.string());
        template.setHashKeySerializer(RedisSerializer.string());
        template.setValueSerializer(RedisSerializer.json());
        template.setHashValueSerializer(RedisSerializer.json());
        template.afterPropertiesSet();
        return template;
    }

and after debug, factory is: 666666666

but sometimes, redisTemplate.opsForValue().get cost high, is there any ideas?

zlp1992 avatar Jul 25 '23 06:07 zlp1992