From b6f900dd98a101250e838fb84a05a422b7a122ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Wollschl=C3=A4ger?= Date: Tue, 24 Jan 2023 14:22:43 +0100 Subject: [PATCH] Add Redis application properties example For the `Connect to Redis` section in the documentation also mention how to configure the Redis connection via application properties similar to the other connectors (Mongodb, Elasticsearch, Neo4j, ...). See gh-33965 --- .../src/docs/asciidoc/data/nosql.adoc | 13 +++++++++++++ 1 file changed, 13 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 d9724f7ca9..d1554e12d1 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 @@ -48,7 +48,20 @@ If you add your own `@Bean` of any of the auto-configured types, it replaces the By default, a pooled connection factory is auto-configured if `commons-pool2` is on the classpath. +Alternatively, you can specify connection details using discrete properties. +For example, you might declare the following settings in your `application.properties`: +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] +---- + spring: + data: + redis: + host: "localhost" + port: 6379 + database: 0 + username: "user" + password: "secret" +---- [[data.nosql.mongodb]] === MongoDB