spring redis组件区别
·
下面以当天,即 2023.02.13 来说明
spring-boot-starter-redis
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>Starter for using Redis key-value data store with Spring Data Redis and the Jedis client. Deprecated as of 1.4 in favor of spring-boot-starter-data-redis

由 apache 官网仓库可以得知最后更新日期为 2017年,并且 pom 的 description 上标明使用 spring-boot-starter-data-redis替换 ,此依赖已过期。
spring-boot-starter-data-redis
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.6.9</version>
</dependency>Starter for using Redis key-value data store with Spring Data Redis and the Lettuce client

由 apache 官网仓库可以得知最后更新日期为 2023年。
spring-boot-starter-data-redis-reactive
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
<version>2.6.9</version>
</dependency>Starter for using Redis key-value data store with Spring Data Redis reactive and the Lettuce client
由此介绍可以得知,通过 reactive 方式访问 redis。
RedisTemplate 实现了接口 RedisOperations
ReactiveRedisTemplate 实现了接口 ReactiveRedisOperations,ReactiveRedisOperations 中引入了 reactor 相关的类。

由 apache 官网仓库可以得知最后更新日期为 2023年。
查看 pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
<version>2.6.9</version>
<name>spring-boot-starter-data-redis-reactive</name>
<description>Starter for using Redis key-value data store with Spring Data Redis reactive and the Lettuce client</description>
<url>https://spring.io/projects/spring-boot</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>https://spring.io</url>
</organization>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<developers>
<developer>
<name>Pivotal</name>
<email>info@pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/spring-projects/spring-boot.git</connection>
<developerConnection>scm:git:ssh://git@github.com/spring-projects/spring-boot.git</developerConnection>
<url>https://github.com/spring-projects/spring-boot</url>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/spring-projects/spring-boot/issues</url>
</issueManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.6.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
得知引用了 spring-boot-starter-data-redis,由此得知 spring-boot-starter-data-redis-reactive 和
spring-boot-starter-data-redis 是指一个。
更多推荐



所有评论(0)