@Configuration @AutoConfigureAfter(value=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration.class) @EnableConfigurationProperties(value=RedisProperties.class) public class RedisAutoConfig extends Object
| 构造器和说明 |
|---|
RedisAutoConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
Redis |
redis(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate,
org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate) |
org.springframework.data.redis.core.RedisTemplate<String,Object> |
yueRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
支持FastJson进行Redis存储对象序列/反序列化
https://github.com/alibaba/fastjson/wiki/%E5%9C%A8-Spring-%E4%B8%AD%E9%9B%86%E6%88%90-Fastjson
|
@Bean public org.springframework.data.redis.core.RedisTemplate<String,Object> yueRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
支持FastJson进行Redis存储对象序列/反序列化
https://github.com/alibaba/fastjson/wiki/%E5%9C%A8-Spring-%E4%B8%AD%E9%9B%86%E6%88%90-Fastjson
@Bean
@Primary
@ConditionalOnBean(value={org.springframework.data.redis.core.RedisTemplate.class,org.springframework.data.redis.core.StringRedisTemplate.class})
public Redis redis(@Qualifier(value="yueRedisTemplate")
org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate,
org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.