Commit 9f998d61 authored by Stephane Nicoll's avatar Stephane Nicoll

Switch redis starter to use Lettuce

This commit changes the default client to Lettuce. This has the side
effect of making the `spring-boot-starter-redis-reactive` irrelevant.

Recent improvements made pooling optional so `commons-pool2` is no
longer provided by default either.

Closes gh-10480
parent 0389fbae
......@@ -3029,13 +3029,12 @@ normal in a Spring Boot application (you normally only have one application cont
[[howto-use-lettuce-instead-of-jedis]]
=== Use Lettuce instead of Jedis
[[howto-use-jedis-instead-of-lettuce]]
=== Use Jedis instead of Lettuce
The Spring Boot starter (`spring-boot-starter-data-redis`) uses
https://github.com/xetorthio/jedis/[Jedis] by default. You need to exclude that dependency
and include the https://github.com/lettuce-io/lettuce-core/[Lettuce] one instead. You also
need `commons-pool2`. Spring Boot manages these dependencies to help make this process as
easy as possible.
https://github.com/lettuce-io/lettuce-core/[Lettuce] by default. You need to exclude that
dependency and include the https://github.com/xetorthio/jedis/[Jedis] one instead. Spring
Boot manages these dependencies to help make this process as easy as possible.
Example in Maven:
......@@ -3046,18 +3045,14 @@ Example in Maven:
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
----
......@@ -3066,12 +3061,11 @@ Example in Gradle:
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
configurations {
compile.exclude module: "jedis"
compile.exclude module: "lettuce"
}
dependencies {
compile("io.lettuce:lettuce-core")
compile("org.apache.commons:commons-pool2")
compile("redis.clients:jedis")
// ...
}
----
......@@ -3352,14 +3352,13 @@ http://projects.spring.io/spring-data[projects.spring.io/spring-data].
=== Redis
http://redis.io/[Redis] is a cache, message broker and richly-featured key-value store.
Spring Boot offers basic auto-configuration for the
https://github.com/xetorthio/jedis/[Jedis] and https://github.com/mp911de/lettuce/[Lettuce]
client library and abstractions on top of it provided by
https://github.com/spring-projects/spring-data-redis[Spring Data Redis].
https://github.com/lettuce-io/lettuce-core/[Lettuce] and
https://github.com/xetorthio/jedis/[Jedis] client library and abstractions on top of it
provided by https://github.com/spring-projects/spring-data-redis[Spring Data Redis].
There is a `spring-boot-starter-data-redis` '`Starter`' for collecting the dependencies in
a convenient way that uses https://github.com/xetorthio/jedis/[Jedis] by default. If you
are building a reactive application, the `spring-boot-starter-data-redis-reactive`
'`Starter`' will get you going.
a convenient way that uses https://github.com/lettuce-io/lettuce-core/[Lettuce] by
default. Both traditional and regular applications are handled by that starter.
......@@ -3387,8 +3386,8 @@ instance will attempt to connect to a Redis server using `localhost:6379`:
----
TIP: You can also register an arbitrary number of beans implementing
`JedisClientConfigurationBuilderCustomizer` for more advanced customizations. If you are
using Lettuce, `LettuceClientConfigurationBuilderCustomizer` is also available.
`LettuceClientConfigurationBuilderCustomizer` for more advanced customizations. If you are
using Jedis, `JedisClientConfigurationBuilderCustomizer` is also available.
If you add a `@Bean` of your own of any of the auto-configured types it will replace the
default (except in the case of `RedisTemplate` the exclusion is based on the bean name
......
......@@ -38,7 +38,6 @@
<module>spring-boot-starter-data-mongodb-reactive</module>
<module>spring-boot-starter-data-neo4j</module>
<module>spring-boot-starter-data-redis</module>
<module>spring-boot-starter-data-redis-reactive</module>
<module>spring-boot-starter-data-rest</module>
<module>spring-boot-starter-data-solr</module>
<module>spring-boot-starter-freemarker</module>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starters</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
</parent>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
<name>Spring Boot Data Redis Reactive Starter</name>
<description>Starter for using Redis key-value data store with Spring Data Redis
reactive and the Lettuce client</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<executions>
<execution>
<id>duplicate-dependencies</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<ignoredResourcePatterns>
<ignoredResourcePattern>changelog.txt</ignoredResourcePattern>
</ignoredResourcePatterns>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -9,7 +9,7 @@
<artifactId>spring-boot-starter-data-redis</artifactId>
<name>Spring Boot Data Redis Starter</name>
<description>Starter for using Redis key-value data store with Spring Data Redis and
the Jedis client</description>
the Lettuce client</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
......@@ -34,8 +34,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
</dependencies>
<build>
......
provides: spring-data-redis,jedis
\ No newline at end of file
provides: spring-data-redis,lettuce-core
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment