Skip to content

Commit 0184548

Browse files
committed
Merge branch '2.7.x' into 3.0.x
Closes gh-34041
2 parents f2361dd + 4aa82a3 commit 0184548

File tree

1 file changed

+15
-1
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/data

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,25 @@ TIP: We also provide a `spring-boot-starter-data-redis-reactive` "`Starter`" for
3434
[[data.nosql.redis.connecting]]
3535
==== Connecting to Redis
3636
You can inject an auto-configured `RedisConnectionFactory`, `StringRedisTemplate`, or vanilla `RedisTemplate` instance as you would any other Spring Bean.
37-
By default, the instance tries to connect to a Redis server at `localhost:6379`.
3837
The following listing shows an example of such a bean:
3938

4039
include::code:MyBean[]
4140

41+
By default, the instance tries to connect to a Redis server at `localhost:6379`.
42+
You can specify custom connection details using `spring.data.redis.*` properties, as shown in the following example:
43+
44+
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
45+
----
46+
spring:
47+
data:
48+
redis:
49+
host: "localhost"
50+
port: 6379
51+
database: 0
52+
username: "user"
53+
password: "secret"
54+
----
55+
4256
TIP: You can also register an arbitrary number of beans that implement `LettuceClientConfigurationBuilderCustomizer` for more advanced customizations.
4357
`ClientResources` can also be customized using `ClientResourcesBuilderCustomizer`.
4458
If you use Jedis, `JedisClientConfigurationBuilderCustomizer` is also available.

0 commit comments

Comments
 (0)