Skip to content

Commit b6f900d

Browse files
marcel-wollschlaegerwilkinsona
authored andcommitted
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
1 parent 66e1905 commit b6f900d

File tree

1 file changed

+13
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/data

1 file changed

+13
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,20 @@ If you add your own `@Bean` of any of the auto-configured types, it replaces the
4848

4949
By default, a pooled connection factory is auto-configured if `commons-pool2` is on the classpath.
5050

51+
Alternatively, you can specify connection details using discrete properties.
52+
For example, you might declare the following settings in your `application.properties`:
5153

54+
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
55+
----
56+
spring:
57+
data:
58+
redis:
59+
host: "localhost"
60+
port: 6379
61+
database: 0
62+
username: "user"
63+
password: "secret"
64+
----
5265

5366
[[data.nosql.mongodb]]
5467
=== MongoDB

0 commit comments

Comments
 (0)