本文主要介绍如何在 springboot 项目中集成使用 Redis。springboot 将很多基础的工具组件都封装成了一个个的 starter,比如基础的 web 框架相关的 pring-boot-starter-web,操作数据库相关的 spring-boot-starter-data-jpa 等等。如果要操作 Redis,同理需要引入 redis 相关的 starter:spring-boot-starter-data-redis。下面介绍 springboot 集成使用 Redis 的详细过程。
1、引入 redis starter POM 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifac