redis It seems like server has closed the connection
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i want to use redis sub/pub, but when i subscribe one channel, 2 minutes after,console output Exception: It seems like server has closed the connection. redis version:redis-3.0.3 jedis version:2.3.0 os:OS X Yosemite 10.10.5 Subscribe.class JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxIdle(10); jedisPoolConfig.setMaxWait(4000); jedisPoolConfig.setTestOnBorrow(true); JedisPool jedisPool = new JedisPool(jedisPoolConfig, "127.0.0.1", 6379); final Jedis jedis = jedisPool.getResource(); System.out.println(jedis