Redis---helloWord

安装原文链接:

https://www.cnblogs.com/M-LittleBird/p/5902850.html

打开git:

git clone https://github.com/MSOpenTech/redis/tags


与springboot整合:

1.appliaction.properties文件:

redis.host=localhost

redis.port=6379

redis.timeout=3
redis.password=pwd
redis.poolMaxTotal=10
redis.poolMaxIdle=10

redis.poolMaxWait=3

2.maven依赖:

<dependency>

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>

</dependency>

3.创建redisConfig配置类,通过JedisPoolConfig获取redis连接,创建redisService来把Redis和业务整合在一起。

依赖关系为:redisService--->redisPool--->JedisPoolConfig--->redis数据库

当你的应用使用到redis后架构层次为:

webApp--->controller--->serivce--->model--->redis--->mysql/oracle

猜你喜欢

转载自blog.csdn.net/qq_35420123/article/details/80716954