@Configuration
@EnableCaching
public class RedisConfig
extends org.springframework.cache.annotation.CachingConfigurerSupport
| Constructor and Description |
|---|
RedisConfig() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.cache.CacheManager |
cacheManager(org.springframework.data.redis.core.RedisTemplate redisTemplate)
缓存管理器
|
org.springframework.cache.interceptor.KeyGenerator |
keyGenerator()
自定义key(消息队列 暂时用不到 自行忽略)
此方法将会根据类名+方法名+所有参数的值生成唯一的一个key,即使@Cacheable中的value属性一样,key也会不一样。
|
org.springframework.data.redis.core.RedisTemplate<Object,Object> |
redisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
序列化Java对象
|
@Bean public org.springframework.cache.interceptor.KeyGenerator keyGenerator()
keyGenerator in interface org.springframework.cache.annotation.CachingConfigurerkeyGenerator in class org.springframework.cache.annotation.CachingConfigurerSupport@Bean public org.springframework.cache.CacheManager cacheManager(org.springframework.data.redis.core.RedisTemplate redisTemplate)
redisTemplate - Copyright © 2018 Pivotal Software, Inc.. All rights reserved.