txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/redis/RedisConfiguration.java
@Bean
    @ConditionalOnClass(name = "org.springframework.data.redis.connection.RedisConnectionFactory")
    public RedisTemplate<String, Object> functionDomainRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
        JdkSerializationRedisSerializer serializationRedisSerializer = new JdkSerializationRedisSerializer();
        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
        redisTemplate.setKeySerializer(stringRedisSerializer);
        redisTemplate.setHashKeySerializer(stringRedisSerializer);
        redisTemplate.setHashValueSerializer(serializationRedisSerializer);
        redisTemplate.setValueSerializer(serializationRedisSerializer);
        redisTemplate.setConnectionFactory(redisConnectionFactory);
        return redisTemplate;
    }
@Bean
    @ConditionalOnClass(name = "org.springframework.data.redis.connection.RedisConnectionFactory")
    public RedisTemplate<String, Object> functionDomainRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
        JdkSerializationRedisSerializer serializationRedisSerializer = new JdkSerializationRedisSerializer();
        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
        redisTemplate.setKeySerializer(stringRedisSerializer);
        redisTemplate.setHashKeySerializer(stringRedisSerializer);
        redisTemplate.setHashValueSerializer(serializationRedisSerializer);
        redisTemplate.setValueSerializer(serializationRedisSerializer);
        redisTemplate.setConnectionFactory(redisConnectionFactory);
        return redisTemplate;
    }
@ Bean @ ConditionalOnClass ( name = "org.springframework.data.redis.connection.RedisConnectionFactory" ) public RedisTemplate < String , Object > functionDomainRedisTemplate ( RedisConnectionFactory redisConnectionFactory ) { JdkSerializationRedisSerializer serializationRedisSerializer = new JdkSerializationRedisSerializer ( ) ; StringRedisSerializer stringRedisSerializer = new StringRedisSerializer ( ) ; RedisTemplate < String , Object > redisTemplate = new RedisTemplate <> ( ) ; redisTemplate . setKeySerializer ( stringRedisSerializer ) ; redisTemplate . setHashKeySerializer ( stringRedisSerializer ) ; redisTemplate . setHashValueSerializer ( serializationRedisSerializer ) ; redisTemplate . setValueSerializer ( serializationRedisSerializer ) ; redisTemplate . setConnectionFactory ( redisConnectionFactory ) ; return redisTemplate ; }
default configuration redis template when have RedisConnectionFactory
default configuration redis template when have RedisConnectionFactory