Redis都要老了,你还在用什么古董客户端?

复制Jedis jedis = null; try { jedis = pool.getResource(); /// ... do stuff here ... for example jedis.set("foo",都端 "bar"); String foobar = jedis.get("foo"); jedis.zadd("sose", 0, "car"); jedis.zadd("sose", 0, "bike"); Set<String> sose = jedis.zrange("sose", 0, -1); } finally { // You have toclose jedis object. If you dont closethen // it doesnt release back to pool and you cant get a new // resource from pool. if (jedis != null) { jedis.close(); } } /// ... when closing your application: pool.close(); 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.