Spring Boot 学习(一) redis粗略学习
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
spring-boot-autoconfigure-2.5.2.jar在这个包下的data文件夹下有redis的整合

自动配置类RedisAutoConfiguration
里面的
@EnableConfigurationProperties(RedisProperties.class) -> RedisProperties里面配置了
@ConfigurationProperties(prefix = "spring.redis") spring.redis.xxx下面的所有是对redis的配置
在自动配置类中,连接工厂是准备好了的,导入了2个类,一个是客户端LettuceConnectionConfiguration,另一个是客户端JedisConnectionConfiguration
@Import({ LettuceConnectionConfiguration.class, JedisConnectionConfiguration.class })
自动注入了两个Template
RedisTemplate<Object, Object> key value, 都可以是Object
StringRedisTemplate key value 都是String
可以在阿里云申请redis
如果要使用jedis需要在pom.xml中导入对应的jedis

浙公网安备 33010602011771号