Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to connect to redis in java using lettuce. Following is my code

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;

RedisClient redisClient = RedisClient.create("redis://192.168.42.223/0");
StatefulRedisConnection<String, String> redisConnection = redisClient.connect();

I am getting following error.

Unable to connect to 192.168.42.223/<unresolved>:6379

in exception following is showing as cause (Exception e.cause)

"java.lang.IllegalStateException: RedisHandshakeHandler not registered"

What wrong am I doing?

I found that if I use older version of lettuce (3.2.Final) as following, then it works (official site is using older version https://redislabs.com/lp/redis-java/).

import com.lambdaworks.redis.*;

RedisClient redisClient = new RedisClient(RedisURI.create("redis://192.168.42.223"));
RedisConnection<String, String> connection = redisClient.connect();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.6k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...