springboot1.x和2.x对于整合redis略有不同,需注意。

1、依赖、配置文件

先引入redis的starter:

<!-- redis依赖 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- cache依赖 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-cache</artifactId>
</dependency>
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2021-08-21
  • 2021-06-26
  • 2021-04-23
  • 2021-07-16
相关资源
相似解决方案