Search code examples
redisjedis

what we can use for JedisExhaustedPoolException in jedis 4.0.1 since its deprecated


I am using version of 3.8.0 Jedis and i am making use of one of the exceptions

import redis.clients.jedis.exceptions.JedisExhaustedPoolException;

public Jedis getJedisObj() {
    try {
        return jedisPool.getResource();
    } catch (JedisConnectionException npe) {
        LOGGER.error("Not able to get redis connection {}", npe);
    } catch (JedisExhaustedPoolException npe) {
        LOGGER.error("Not able to get redis connection, because of pool exhausted {}", npe);
    }
    return null;
}

i want to upgrade to jedis 4.0.1 .Since this redis.clients.jedis.exceptions.JedisExhaustedPoolException is depreacted in 4.0.1 what can i use to replace that


Solution

  • redis.clients.jedis.exceptions.JedisException.

    From Jedis 3 to 4 doc:

    JedisExhaustedPoolException has been removed. A JedisException with a similar message is thrown instead.