Skip to content

Commit 25b3711

Browse files
Updating README.adoc
1 parent bf7fbe0 commit 25b3711

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.adoc

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To use Redis multi-data sources, you need to add the Redis Multi Sources Spring
2323
Add the following configuration to your properties file.
2424
[source,properties]
2525
----
26-
# set the primary-key data source
26+
# set the primary-key data source (must)
2727
spring.multi-sources.redis.primary-key=cn
2828
2929
# cn data source
@@ -54,7 +54,7 @@ spring.multi-sources.redis.sources.us.password=Asd12345!.
5454
spring:
5555
multi-sources:
5656
redis:
57-
# Set the primary-key data source
57+
# set the primary-key data source (must)
5858
primary-key: cn
5959
6060
# cn data source
@@ -91,6 +91,27 @@ spring:
9191
max-redirects: 3
9292
password: Asd12345!.
9393
----
94+
=== Redis Multi Source Runtime
95+
Redis Multi Sources Spring Boot Starter will create multiple sets of `LettuceConnectionFactory`, `RedisTemplate`, and `StringRedisTemplate` beans based on the configuration and register them in the Spring container.
96+
97+
The naming convention for the bean names is: `sourceName` + `className`. Therefore, the usage is as follows:
98+
[source,java]
99+
----
100+
@Autowired
101+
@Qualifier("cnStringRedisTemplate")
102+
private StringRedisTemplate stringRedisTemplate;
103+
104+
105+
@Autowired
106+
@Qualifier("hkRedisTemplate")
107+
private RedisTemplate<String, Object> redisTemplate;
108+
109+
110+
@Autowired
111+
@Qualifier("usLettuceConnectionFactory")
112+
private RedisConnectionFactory redisConnectionFactory;
113+
114+
----
94115

95116
== License
96117

0 commit comments

Comments
 (0)