If what you want to do is set Jedis connection timeout
, you should do it using the special constructor made for that:
public Jedis(final String host, final int port, final int timeout)
What you are doing is setting the timeout on Redis settings from Jedis
. Doing CONFIG SET timeout 60
, means that Redis will close idle client connections after 60
seconds. That's why you get the exception in Jedis.