jedisPool.returnBrokenResource 弃用

 

       for (int i = 0; i < 1000000 ; i++) {
//使用Pool的方式 调用Redis
JedisPool jedisPool = SpringContextHolder.getBean(JedisPool.class);
Jedis jedis = jedisPool.getResource();
String key = "testKey";
jedis.set(key,"fasdfasdfasdfasdfasdf");

String data = jedis.get(key);

System.out.println(i+"--" + data);
jedis.close();
// jedisPool.returnBrokenResource(jedis);
}
 
 
目测 close 性能要比 returnBrokenResource 高

转载于:https://www.cnblogs.com/zbw911/p/6206327.html

你可能感兴趣的:(jedisPool.returnBrokenResource 弃用)