SpringBoot整合redis

快速搭建

  我们只需在构建springboot时选上redis依赖,springboot就会自动构建redis的依赖。

  我们可以在要使用redis的地方配置RedisTemplate

  这样spring就会自动帮我们在核心容器中构建redisTemplate供我们使用

配置redis

  springboot的redis默认连的是本机,如果要配置redis我们只需在springboot的配置文件中进行配置,例如我们要配置redis的连接地址和端口号

一点一点积累,一点一点蜕变!
原文地址:https://www.cnblogs.com/qq2210446939/p/15047277.html