spring-boot-starter-data-redis

一、几个依赖的关系

在spring与redis整合时有下面几种:

spring-boot-starter-data-redis

spring-boot-starter-redis

spring-data-redis

其中,spring-boot-starter-data-redis和spring-boot-starter-redis中都包含有spring-data-redis, 现在基本使用的都是 spring-boot-starter-data-redis

二、配置文件

注意:如果不配置,默认以单节点形式连接本地的无密码redis。

配置对应 org.springframework.boot.autoconfigure.data.redis.RedisProperties

三、作用

1、默认使用lettuce

spring-boot-starter-data-redis默认是使用lettuce去访问redis

2、内置(String)RedisTemplate

内置了StringRedisTemplate和RedisTemplate,应用可以直接使用。而Jedis、Redisson还需要在此基础上增加额外的依赖。

相关推荐
java1234_小锋12 分钟前
Java高频面试题:Springboot的自动配置原理?
java·spring boot·面试
末央&1 小时前
【天机论坛】项目环境搭建和数据库设计
java·数据库
枫叶落雨2221 小时前
ShardingSphere 介绍
java
花花鱼1 小时前
Spring Security 与 Spring MVC
java·spring·mvc
言慢行善2 小时前
sqlserver模糊查询问题
java·数据库·sqlserver
专吃海绵宝宝菠萝屋的派大星2 小时前
使用Dify对接自己开发的mcp
java·服务器·前端
大数据新鸟2 小时前
操作系统之虚拟内存
java·服务器·网络
Tong Z2 小时前
常见的限流算法和实现原理
java·开发语言
凭君语未可3 小时前
Java 中的实现类是什么
java·开发语言
He少年3 小时前
【基础知识、Skill、Rules和MCP案例介绍】
java·前端·python