Skip to content

Add Redis application properties example #33965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down