jedis compatibility with redis 3.2.1

1,408 views
Skip to first unread message

harisa...@shieldsquare.com

unread,
Jul 12, 2016, 10:50:01 AM7/12/16
to Jedis
Hi all,
We are currently using redis 2.8.22 accessed by jedis 2.8.0. We want to upgrade to redis 3.2. However the jedis github page only says "Jedis is fully compatible with redis 2.8.x and 3.0.x". Wanted to know if we upgrade the redis from 2.8.22 to 3.2.1, and not use any additional operations like "geo" from jedis 2.8.22, will it be ok?

In other words, can we use jedis 2.8.0 to connect to redis 3.2.1 if we ensure that the operations we use from jedis will be compatible with redis 2.8.22 ?

Thanks in advance,
Harisankar H

Jonathan Leibiusky

unread,
Jul 12, 2016, 10:55:44 AM7/12/16
to Jedis
As far as I know there is not backward incompatible change in redis, so you should be able to use jedis with latest redis with no problem.
Of course new commands and options won't be available for you.


--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sura...@shieldsquare.com

unread,
Jul 29, 2016, 8:44:23 AM7/29/16
to Jedis
Hi Jonathan,

I've tried using jedis 2.8.1 with redis 3.2. I am using jedispool in our code. Whenever the code is trying to get a resource from the pool it throws ConnectionException

Connection Exception is:
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at redis.clients.util.Pool.getResource(Pool.java:50)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:99)
        at main.com.arrayshield.sdk.ss.dataprocessing.ParseJS.run(ParseJS.java:90)
        at java.lang.Thread.run(Thread.java:745)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
        at redis.clients.jedis.Connection.connect(Connection.java:164)
        at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:80)
        at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1676)
        at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:87)
        at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:836)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:434)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:361)
        at redis.clients.util.Pool.getResource(Pool.java:48)

Jonathan Leibiusky

unread,
Aug 3, 2016, 8:33:33 AM8/3/16
to Jedis
Hi, this seems to be something related with how you configure your pool to connect to redis and not an incompatibility issue.
I guess wither the host or the port are wrong?
Can you please double check that? Also make sure you can connect to redis from where your are trying to connect using telnet.

Allan Wax

unread,
Aug 4, 2016, 2:52:30 PM8/4/16
to Jedis
I usually find that that message means you're out of connections or you have a transient network issue.  Or if not clustered, you're not returning connections to the pool.

For non-clustered use, it's much safer to use the Java try-with-resources to acquire and use resources since they are now (auto)Closable.  Something like this:

```
try (Jedis jedis = pool.getResource()) {

// do something with jedis

}
```
and at the end of the block the resource will be automatically returned to the pool even if there is an exception in the block that causes the block to be left.
Reply all
Reply to author
Forward
0 new messages