Skip to content

Commit 4f55be5

Browse files
Updating README.adoc to add jedis usage.
1 parent 6e7bb29 commit 4f55be5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ To use Redis multi-data sources, you need to add the Redis Multi Sources Spring
2020
<version>2.2</version>
2121
</dependency>
2222
----
23+
To use Jedis instead of Lettuce as the client, you need to add the following dependencies:
24+
[source, xml]
25+
----
26+
<dependency>
27+
<groupId>redis.clients</groupId>
28+
<artifactId>jedis</artifactId>
29+
</dependency>
30+
----
31+
32+
2333
Add the following configuration to your properties file.
2434
[source,properties]
2535
----
@@ -34,6 +44,8 @@ spring.multi-sources.redis.source.cn.password=Asd12345!.
3444
# hk data source
3545
spring.multi-sources.redis.sources.hk.sentinel.master=hk-redis-master
3646
spring.multi-sources.redis.sources.hk.database=0
47+
# jedis client
48+
spring.multi-sources.redis.sources.hk.client-type=jedis
3749
spring.multi-sources.redis.sources.hk.password=Asd12345!.
3850
spring.multi-sources.redis.sources.hk.lettuce.pool.enabled=true
3951
spring.multi-sources.redis.sources.hk.sentinel.nodes[0]=192.168.1.1:26379
@@ -75,6 +87,8 @@ spring:
7587
- 192.168.1.2:26379
7688
- 192.168.1.2:26379
7789
database: 0
90+
# jedis client
91+
client-type: jedis
7892
password: Asd12345!.
7993
lettuce:
8094
pool:
@@ -92,7 +106,7 @@ spring:
92106
password: Asd12345!.
93107
----
94108
=== 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.
109+
Redis Multi Sources Spring Boot Starter will create multiple sets of `LettuceConnectionFactory` or `JedisConnectionFactory`, `RedisTemplate`, and `StringRedisTemplate` beans based on the configuration and register them in the Spring container.
96110

97111
The naming convention for the bean names is: `sourceName` + `className`. Therefore, the usage is as follows:
98112
[source,java]
@@ -111,6 +125,10 @@ private RedisTemplate<String, Object> redisTemplate;
111125
@Qualifier("usLettuceConnectionFactory")
112126
private RedisConnectionFactory redisConnectionFactory;
113127
128+
@Autowired
129+
@Qualifier("hkJedisConnectionFactory")
130+
private RedisConnectionFactory redisConnectionFactory;
131+
114132
----
115133

116134

0 commit comments

Comments
 (0)