Skip to content

Commit 9f998d6

Browse files
committed
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
1 parent 0389fba commit 9f998d6

File tree

7 files changed

+22
-102
lines changed

7 files changed

+22
-102
lines changed

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,13 +3029,12 @@ normal in a Spring Boot application (you normally only have one application cont
30293029

30303030

30313031

3032-
[[howto-use-lettuce-instead-of-jedis]]
3033-
=== Use Lettuce instead of Jedis
3032+
[[howto-use-jedis-instead-of-lettuce]]
3033+
=== Use Jedis instead of Lettuce
30343034
The Spring Boot starter (`spring-boot-starter-data-redis`) uses
3035-
https://github.com/xetorthio/jedis/[Jedis] by default. You need to exclude that dependency
3036-
and include the https://github.com/lettuce-io/lettuce-core/[Lettuce] one instead. You also
3037-
need `commons-pool2`. Spring Boot manages these dependencies to help make this process as
3038-
easy as possible.
3035+
https://github.com/lettuce-io/lettuce-core/[Lettuce] by default. You need to exclude that
3036+
dependency and include the https://github.com/xetorthio/jedis/[Jedis] one instead. Spring
3037+
Boot manages these dependencies to help make this process as easy as possible.
30393038

30403039
Example in Maven:
30413040

@@ -3046,18 +3045,14 @@ Example in Maven:
30463045
<artifactId>spring-boot-starter-data-redis</artifactId>
30473046
<exclusions>
30483047
<exclusion>
3049-
<groupId>redis.clients</groupId>
3050-
<artifactId>jedis</artifactId>
3048+
<groupId>io.lettuce</groupId>
3049+
<artifactId>lettuce-core</artifactId>
30513050
</exclusion>
30523051
</exclusions>
30533052
</dependency>
30543053
<dependency>
3055-
<groupId>io.lettuce</groupId>
3056-
<artifactId>lettuce-core</artifactId>
3057-
</dependency>
3058-
<dependency>
3059-
<groupId>org.apache.commons</groupId>
3060-
<artifactId>commons-pool2</artifactId>
3054+
<groupId>redis.clients</groupId>
3055+
<artifactId>jedis</artifactId>
30613056
</dependency>
30623057
----
30633058

@@ -3066,12 +3061,11 @@ Example in Gradle:
30663061
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
30673062
----
30683063
configurations {
3069-
compile.exclude module: "jedis"
3064+
compile.exclude module: "lettuce"
30703065
}
30713066
30723067
dependencies {
3073-
compile("io.lettuce:lettuce-core")
3074-
compile("org.apache.commons:commons-pool2")
3068+
compile("redis.clients:jedis")
30753069
// ...
30763070
}
30773071
----

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,14 +3352,13 @@ http://projects.spring.io/spring-data[projects.spring.io/spring-data].
33523352
=== Redis
33533353
http://redis.io/[Redis] is a cache, message broker and richly-featured key-value store.
33543354
Spring Boot offers basic auto-configuration for the
3355-
https://github.com/xetorthio/jedis/[Jedis] and https://github.com/mp911de/lettuce/[Lettuce]
3356-
client library and abstractions on top of it provided by
3357-
https://github.com/spring-projects/spring-data-redis[Spring Data Redis].
3355+
https://github.com/lettuce-io/lettuce-core/[Lettuce] and
3356+
https://github.com/xetorthio/jedis/[Jedis] client library and abstractions on top of it
3357+
provided by https://github.com/spring-projects/spring-data-redis[Spring Data Redis].
33583358

33593359
There is a `spring-boot-starter-data-redis` '`Starter`' for collecting the dependencies in
3360-
a convenient way that uses https://github.com/xetorthio/jedis/[Jedis] by default. If you
3361-
are building a reactive application, the `spring-boot-starter-data-redis-reactive`
3362-
'`Starter`' will get you going.
3360+
a convenient way that uses https://github.com/lettuce-io/lettuce-core/[Lettuce] by
3361+
default. Both traditional and regular applications are handled by that starter.
33633362

33643363

33653364

@@ -3387,8 +3386,8 @@ instance will attempt to connect to a Redis server using `localhost:6379`:
33873386
----
33883387

33893388
TIP: You can also register an arbitrary number of beans implementing
3390-
`JedisClientConfigurationBuilderCustomizer` for more advanced customizations. If you are
3391-
using Lettuce, `LettuceClientConfigurationBuilderCustomizer` is also available.
3389+
`LettuceClientConfigurationBuilderCustomizer` for more advanced customizations. If you are
3390+
using Jedis, `JedisClientConfigurationBuilderCustomizer` is also available.
33923391

33933392
If you add a `@Bean` of your own of any of the auto-configured types it will replace the
33943393
default (except in the case of `RedisTemplate` the exclusion is based on the bean name

spring-boot-starters/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
<module>spring-boot-starter-data-mongodb-reactive</module>
3939
<module>spring-boot-starter-data-neo4j</module>
4040
<module>spring-boot-starter-data-redis</module>
41-
<module>spring-boot-starter-data-redis-reactive</module>
4241
<module>spring-boot-starter-data-rest</module>
4342
<module>spring-boot-starter-data-solr</module>
4443
<module>spring-boot-starter-freemarker</module>

spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml

Lines changed: 0 additions & 71 deletions
This file was deleted.

spring-boot-starters/spring-boot-starter-data-redis-reactive/src/main/resources/META-INF/spring.provides

Lines changed: 0 additions & 1 deletion
This file was deleted.

spring-boot-starters/spring-boot-starter-data-redis/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<artifactId>spring-boot-starter-data-redis</artifactId>
1010
<name>Spring Boot Data Redis Starter</name>
1111
<description>Starter for using Redis key-value data store with Spring Data Redis and
12-
the Jedis client</description>
12+
the Lettuce client</description>
1313
<url>http://projects.spring.io/spring-boot/</url>
1414
<organization>
1515
<name>Pivotal Software, Inc.</name>
@@ -34,8 +34,8 @@
3434
</exclusions>
3535
</dependency>
3636
<dependency>
37-
<groupId>redis.clients</groupId>
38-
<artifactId>jedis</artifactId>
37+
<groupId>io.lettuce</groupId>
38+
<artifactId>lettuce-core</artifactId>
3939
</dependency>
4040
</dependencies>
4141
<build>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
provides: spring-data-redis,jedis
1+
provides: spring-data-redis,lettuce-core

0 commit comments

Comments
 (0)