From 7386908ce0ecfa06cefdd619005d6a7eb97aef40 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Fri, 9 Aug 2024 14:10:20 +0200 Subject: [PATCH] Document that username and password are not used when Redis url is set Closes gh-41231 --- .../src/docs/asciidoc/data/nosql.adoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc index c1816b18d9..fc99ae1f53 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc @@ -55,6 +55,20 @@ You can specify custom connection details using `spring.data.redis.*` properties password: "secret" ---- +You can also specify the url of the Redis server directly. +When setting the url, the host, port, username and password properties are ignored. +This is shown in the following example: + +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] +---- + spring: + data: + redis: + url: "redis://user:secret@localhost:6379" + database: 0 +---- + + TIP: You can also register an arbitrary number of beans that implement `LettuceClientConfigurationBuilderCustomizer` for more advanced customizations. `ClientResources` can also be customized using `ClientResourcesBuilderCustomizer`. If you use Jedis, `JedisClientConfigurationBuilderCustomizer` is also available.