0

I am facing an issue in which we are getting JedisConnectionException because of timed out. Ours is a multi threaded environment and we are using redis extensively. We are creating the redis pool with the below config,

  JedisPoolConfig config = new JedisPoolConfig();
    config.setTestOnBorrow(true); config.setMaxIdle(1000);
     config.setMaxTotal(1000); config.setBlockWhenExhausted(true);
     config.setMaxWaitMillis(180000); pool = new JedisPool(config,
     getHost(), getPort());

We are releasing the resource back to pool after every use. The exception is as follows

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:42)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused at redis.clients.jedis.Connection.connect(Connection.java:142) at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75) at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1724) at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65) at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363) at redis.clients.util.Pool.getResource(Pool.java:40) ... 4 more Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method)

Can some one please suggest?

techy
  • 261
  • 2
  • 11

0 Answers0