From 9f998d61915d0673ccd4c0a166f3245ccaf85430 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 4 Oct 2017 16:08:27 +0200 Subject: [PATCH] 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 --- spring-boot-docs/src/main/asciidoc/howto.adoc | 28 +++----- .../main/asciidoc/spring-boot-features.adoc | 15 ++-- spring-boot-starters/pom.xml | 1 - .../pom.xml | 71 ------------------- .../main/resources/META-INF/spring.provides | 1 - .../spring-boot-starter-data-redis/pom.xml | 6 +- .../main/resources/META-INF/spring.provides | 2 +- 7 files changed, 22 insertions(+), 102 deletions(-) delete mode 100644 spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml delete mode 100644 spring-boot-starters/spring-boot-starter-data-redis-reactive/src/main/resources/META-INF/spring.provides diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index c0e3523756..350f033763 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -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: spring-boot-starter-data-redis - redis.clients - jedis + io.lettuce + lettuce-core - io.lettuce - lettuce-core - - - org.apache.commons - commons-pool2 + redis.clients + jedis ---- @@ -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") // ... } ---- diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index ced5cf5dd0..ff2c782ca9 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -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 diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index c60fb8c16b..e77dceefce 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -38,7 +38,6 @@ spring-boot-starter-data-mongodb-reactive spring-boot-starter-data-neo4j spring-boot-starter-data-redis - spring-boot-starter-data-redis-reactive spring-boot-starter-data-rest spring-boot-starter-data-solr spring-boot-starter-freemarker diff --git a/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml b/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml deleted file mode 100644 index f7dfb0a04d..0000000000 --- a/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - 2.0.0.BUILD-SNAPSHOT - - spring-boot-starter-data-redis-reactive - Spring Boot Data Redis Reactive Starter - Starter for using Redis key-value data store with Spring Data Redis - reactive and the Lettuce client - http://projects.spring.io/spring-boot/ - - Pivotal Software, Inc. - http://www.spring.io - - - ${basedir}/../.. - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-redis - - - org.slf4j - jcl-over-slf4j - - - - - io.lettuce - lettuce-core - - - org.apache.commons - commons-pool2 - - - io.projectreactor - reactor-core - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - changelog.txt - - - - - - - - diff --git a/spring-boot-starters/spring-boot-starter-data-redis-reactive/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-data-redis-reactive/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 7c4aeabfda..0000000000 --- a/spring-boot-starters/spring-boot-starter-data-redis-reactive/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: spring-data-redis,lettuce-core \ No newline at end of file diff --git a/spring-boot-starters/spring-boot-starter-data-redis/pom.xml b/spring-boot-starters/spring-boot-starter-data-redis/pom.xml index dbfaade326..2821fb0bf0 100644 --- a/spring-boot-starters/spring-boot-starter-data-redis/pom.xml +++ b/spring-boot-starters/spring-boot-starter-data-redis/pom.xml @@ -9,7 +9,7 @@ spring-boot-starter-data-redis Spring Boot Data Redis Starter Starter for using Redis key-value data store with Spring Data Redis and - the Jedis client + the Lettuce client http://projects.spring.io/spring-boot/ Pivotal Software, Inc. @@ -34,8 +34,8 @@ - redis.clients - jedis + io.lettuce + lettuce-core diff --git a/spring-boot-starters/spring-boot-starter-data-redis/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-data-redis/src/main/resources/META-INF/spring.provides index ef52e2ea08..7c4aeabfda 100644 --- a/spring-boot-starters/spring-boot-starter-data-redis/src/main/resources/META-INF/spring.provides +++ b/spring-boot-starters/spring-boot-starter-data-redis/src/main/resources/META-INF/spring.provides @@ -1 +1 @@ -provides: spring-data-redis,jedis \ No newline at end of file +provides: spring-data-redis,lettuce-core \ No newline at end of file