Questions tagged [jedis]

Jedis is a small free client for Redis, written in and for Java.

From its GitHub repository:

Jedis is a Java client for Redis designed for performance and ease of use.

Resources

868 questions
6
votes
3 answers

How to lock redis cluster for an application in java

I've two java applications (app1, app2). Both applications are using JedisCluster client for Redis cluster. app1 write or read data from Redis cluster. app2 is like a scheduler which only writes some data to Redis cluster. it runs after a fixed time…
Md Shihab Uddin
  • 541
  • 5
  • 13
6
votes
1 answer

Common interface for Jedis and JedisCluster

I see that Jedis and JedisCluster don't implement a common java interface, and I am wondering why. My software will be running in different environments where redis may or may not run in cluster mode, so how do I implement a common piece of code…
vrtx54234
  • 2,196
  • 3
  • 30
  • 53
6
votes
1 answer

How should/could I store my JWT tokens in redis so that I can see current user sessions?

I'm using Java with Spring to build a rest api along with a couple of other services. The main functionality being the creation/login of users. I know that there isn't a query language in redis which is why I'm posting the question here! Is there…
James111
  • 15,378
  • 15
  • 78
  • 121
6
votes
1 answer

Connection to remote redis server is reset

Trying the basic set operation on a redis server installed in red hat linux. JedisPool pool = new JedisPool(new JedisPoolConfig(), HOST, PORT); Jedis jedis = null; try { jedis = pool.getResource(); …
Md. Arafat Al Mahmud
  • 3,124
  • 5
  • 35
  • 66
6
votes
1 answer

Why A single Jedis instance is not threadsafe?

https://github.com/xetorthio/jedis/wiki/Getting-started using Jedis in a multithreaded environment You shouldn't use the same instance from different threads because you'll have strange errors. And sometimes creating lots of Jedis instances is not…
BoTaoLiu
  • 65
  • 1
  • 5
6
votes
2 answers

LinkedHashMap behaviour with Redis Hashes?

I want to use Hashes data structure in Redis (Jedis client) but also want to maintain the insertion order something like LinkedHashMap in Java. I am totally new to Redis and gone through all the data structures and commands but somehow not able to…
Ashu
  • 1,703
  • 4
  • 16
  • 23
6
votes
2 answers

Check connection Redis

I am using the Redis in Java using the Jedis client. I am creating a JedisPool and would like to know if the connection is successful, is there a way of doing this without fetching an object?
user2248702
  • 2,741
  • 7
  • 41
  • 69
6
votes
2 answers

what is copy-on-write memory

As I continuously write data to redis, the memory used by copy-on-write keeps increasing. Even though I write my program to sleep long enough so that redis will be able to finish all the background save (last memory message is 0 MB of memory used by…
twb
  • 1,248
  • 4
  • 18
  • 31
6
votes
1 answer

Is order preserved in set when recovering sorted sets using jedis?

I use Java Redis client "Jedis". When getting a sorted set using zrange for example, the client specifies it returns a Set which by definition has no oredering guarantee. this old question mentions the problem but I have found no reference to…
Daren
  • 3,337
  • 4
  • 21
  • 35
6
votes
4 answers

how to store an image to redis using java / spring

I'm using redis and spring framework on my image upload server. I need to store the images to redis. I have found the following question but it was for python. how to store an image into redis using python / PIL I'm not sure if it's the best way…
Gene Diaz
  • 536
  • 1
  • 7
  • 22
6
votes
1 answer

Response Object in Jedis - throws ClassCastException

Using Response Object in Jedis, throws ClassCastException . I am not able to get any value from Redis when I use pipeline. Please help. I am using Jedis 2.1.0 public class JedisPipeline { public static void main(String args[]){ final…
user1182253
  • 1,079
  • 2
  • 14
  • 26
6
votes
1 answer

single command to intersect redis sorted set by ranges

redis: redis>zadd zsetA 1 'A' redis>zadd zsetA 2 'B' redis>zadd zsetA 3 'C' redis>zadd zsetA 5 'E' redis>zadd zsetB 1 'A' redis>zadd zsetB 2 'B' redis>zadd zsetB 3 'C' redis>zadd zsetB 4 'D' opearate: a=redis.ZRANGEBYSCORE…
Charlot
  • 151
  • 1
  • 9
5
votes
1 answer

jedis pubsub and timeouts: how to listen infinitely as subscriber?

I'm struggling with the concept of creating a Jedis-client which listens infinitely as a subscriber to a Redis pubsub channel and handles messages when they come in. My problem is that after a while of inactivity the server stops responding…
Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
5
votes
2 answers

JedisConnectionException: java.net.SocketTimeoutException: connect timed out

I'm using jedis for simple key-value data store... My code is as follows private static final String HOST = "50.30.35.9"; private static final int PORT = 2863; Jedis jedis = new Jedis(HOST, PORT); try { jedis.set("foo", "bar"); …
diya
  • 6,938
  • 9
  • 39
  • 55
5
votes
3 answers

class file for redis.clients.jedis.JedisShardInfo not found

when I upgrade the jedis to version 4.2.3 in gradle.build: api "redis.clients:jedis:4.2.3" show error: /Users/xiaoqiangjiang/source/reddwarf/backend/retire/dolphin-common/src/main/java/misc/config/redis/RedisConfig.java:77: error: cannot access…
Dolphin
  • 29,069
  • 61
  • 260
  • 539