Skip to content

JedisPool configurations

enricruiz edited this page Apr 15, 2011 · 1 revision

JedisPool configurations

Healthy connections in pool

A connection in pool can be reseted by redis due a timeout, then, when you get the connection it is an unhealthy one.

In order to assure that every time you get a connection from the pool it is an healthy one, you must configure the pool with testOnBorrow = true.

Config config = new Config();
config.testOnBorrow = true;

JedisPool jedisPool = new JedisPool(config, "localhost");
JOhm.setPool(jedisPool);
Clone this wiki locally