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还需要在此基础上增加额外的依赖。

相关推荐
TFHoney4 小时前
Java面试第十一山!《SpringCloud框架》
java·spring cloud·面试
大小科圣5 小时前
基于redis实现会话保持
数据库·redis·git
日暮南城故里5 小时前
Java学习------初识JVM体系结构
java·jvm·学习
飞鼠_5 小时前
c++简单实现redis
c++·redis·bootstrap
鱼樱前端6 小时前
Java Jdbc相关知识点汇总
java·后端
canonical_entropy6 小时前
NopReport示例-动态Sheet和动态列
java·后端·excel
kkk哥6 小时前
基于springboot的母婴商城系统(018)
java·spring boot·后端
王者鳜錸7 小时前
四、小白学JAVA-石头剪刀布游戏
java·开发语言·游戏
坚持学习永不言弃7 小时前
【IDEA】 配置安装 Leetcode 插件
java·leetcode·intellij-idea