Spring boot 集成 Redis
定义(摘自百度百科 https://baike.baidu.com/item/Redis/6549233):
步骤:
1.在pom.xml中配置相关的jar依赖
<!--sping boot redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
2.在spring boot核心配置文件application.properties中配置redis连接信息
#redisspring.redis.port=6379 spring.redis.host=localhost spring.redis.password=123456
3.配置了上面的步骤,spring boot将自动配置Redis Template,在需要操作redis的类中注入redis Template
文章来源: Spring boot 集成 Redis