Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbc933a

Browse files
committed
add jedis codeing sample
1 parent a7e952e commit fbc933a

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

springboot-jedis-sample/src/main/java/com/ipman/springboot/redis/jedis/sample/config/RedisConfig.java

-12
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ public class RedisConfig {
2727
@Value("${spring.redis.timeout}")
2828
private int timeout;
2929

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-
4230
@Bean
4331
@ConfigurationProperties("redis")
4432
public JedisPoolConfig jedisPoolConfig() {

springboot-jedis-sample/src/main/resources/application.properties

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ spring.redis.host=10.211.55.6
66
spring.redis.port=6379
77
#Redis密码
88
spring.redis.password=
9+
#控制一个pool可分配多少个jedis实例
910
spring.redis.jedis.pool.max-active=100
11+
#表示borrow一个jedis实例是,最大等待的时间,如果超时,直接抛出jedisConnectionException
1012
spring.redis.jedis.pool.max-wait=1000
13+
#控制一个poll最多有多少个状态为idle的jedis实例,超出这个阈值会clonse掉超出的连接
1114
spring.redis.jedis.pool.max-idle=100
1215
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

0 commit comments

Comments
 (0)