File tree 2 files changed +5
-14
lines changed
springboot-jedis-sample/src/main
java/com/ipman/springboot/redis/jedis/sample/config
2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,6 @@ public class RedisConfig {
27
27
@ Value ("${spring.redis.timeout}" )
28
28
private int timeout ;
29
29
30
- @ Value ("${spring.redis.jedis.pool.max-idle}" )
31
- private int maxIdle ;
32
-
33
- @ Value ("${spring.redis.jedis.pool.max-wait}" )
34
- private long maxWaitMillis ;
35
-
36
- @ Value ("${spring.redis.password}" )
37
- private String password ;
38
-
39
- @ Value ("${spring.redis.block-when-exhausted}" )
40
- private boolean blockWhenExhausted ;
41
-
42
30
@ Bean
43
31
@ ConfigurationProperties ("redis" )
44
32
public JedisPoolConfig jedisPoolConfig () {
Original file line number Diff line number Diff line change @@ -6,9 +6,12 @@ spring.redis.host=10.211.55.6
6
6
spring.redis.port =6379
7
7
# Redis密码
8
8
spring.redis.password =
9
+ # 控制一个pool可分配多少个jedis实例
9
10
spring.redis.jedis.pool.max-active =100
11
+ # 表示borrow一个jedis实例是,最大等待的时间,如果超时,直接抛出jedisConnectionException
10
12
spring.redis.jedis.pool.max-wait =1000
13
+ # 控制一个poll最多有多少个状态为idle的jedis实例,超出这个阈值会clonse掉超出的连接
11
14
spring.redis.jedis.pool.max-idle =100
12
15
spring.redis.jedis.pool.min-idle =0
13
- spring.redis.timeout = 10000
14
- spring.redis.block-when-exhausted = true
16
+ # Jedis连接超时时间
17
+ spring.redis.timeout = 10000
You can’t perform that action at this time.
0 commit comments