1

I'm having problems figuring out how to use the Jedis library to connect to a redis socket connection.

I know how to connect through a network port:

Jedis jedis = new Jedis("localhost");
//Jedis jedis = new Jedis(unix_socket_path="/tmp/redis.sock");

But the socket connection(second in the list) doesn't work. The commands looked simlair to redis-py(python client) but when I tried the same syntax it didn't work. I also looked through the jedis sourcecode on github but couldn't see anything. Any ideas?

Lostsoul
  • 23,230
  • 42
  • 133
  • 217

1 Answers1

3

I don't think Jedis support unix domain sockets.

The constructor with a single parameter only accepts a hostname (using default TCP port).

Java is portable. It is supposed to provide the same API on different platforms. Unix domain sockets are specific to Unix/Linux. So the Java standard API does not support unix domain sockets. There are separate Java packages for this, but AFAIK, Jedis do not use them.

Community
  • 1
  • 1
Didier Spezia
  • 67,198
  • 11
  • 181
  • 148