Spring boot 集成 Redis

匿名 (未验证) 提交于 2019-12-03 00:44:02

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










标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!