java - Configure Jedis timeout -



java - Configure Jedis timeout -

i'm having problems completing .hgetall, here's i've tried:

jedis jedis = new jedis(redis_master_node); jedis.connect(); jedis.configset("timeout", "30"); map<string, string> alreadystored = jedis.hgetall(redistargethash);

and here's get:

exception in thread "main" redis.clients.jedis.exceptions.jedisconnectionexception: java.net.sockettimeoutexception: read timed out @ redis.clients.jedis.protocol.process(protocol.java:79) @ redis.clients.jedis.protocol.read(protocol.java:131) @ redis.clients.jedis.connection.getbinarymultibulkreply(connection.java:199) @ redis.clients.jedis.jedis.hgetall(jedis.java:851)

ok,

jedis jedis = new jedis(redis_master_node, 6379, 1800);

did it.

if want set jedis connection timeout, should using special constructor made that:

public jedis(final string host, final int port, final int timeout)

what doing setting timeout on redis settings jedis. doing config set timeout 60, means redis close idle client connections after 60 seconds. that's why exception in jedis.

java redis jedis

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -