Questions tagged [jedis]

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

From its GitHub repository:

A blazingly small and sane redis java client

Resources

731 questions
57
votes
5 answers

Why is data getting stored with weird keys in Redis when using Jedis with Spring Data?

I am using Spring Data Redis with Jedis. I am trying to store a hash with key vc:${list_id}. I was able to successfully insert to redis. However, when I inspect the keys using the redis-cli, I don't see the key vc:501381. Instead I see…
arun
  • 9,435
  • 5
  • 48
  • 67
42
votes
1 answer

Redisson vs Jedis for redis

Now I have to use a java client for redis. I have come across Jedis and Redisson. EDIT: Reframing as the question was kind of opinion based. Which is more efficient in terms of speed? Any benchmarks? Which of them is able to provide the…
Shubham Chaurasia
  • 2,096
  • 2
  • 12
  • 20
34
votes
1 answer

How Jedis Pool works?

I'm using Jedis pool to manage connections to Redis server. An example code of mine as follows: public Set getTopArticleList(int start, int end) { Set list = null; Jedis j =…
ipkiss
  • 12,171
  • 26
  • 81
  • 118
31
votes
7 answers

Could not get a resource from the pool(SocketTimeoutException:)

I'm running multiple worker threads(around 10) to access the data from the redis Q. For the i'm using infinte timeout for Jedis Client. Jedis jedis = pool.getResource(); jedis.getClient().setTimeoutInfinite(); Still i'm getting the error "Could…
Vignesh
  • 2,017
  • 7
  • 28
  • 39
30
votes
3 answers

JedisConnectionFactory setHostName is deprecated

This will be my first time connecting Spring to Redis. The documentation for jedis connection factory: http://www.baeldung.com/spring-data-redis-tutorial Offers the following code: @Bean JedisConnectionFactory jedisConnectionFactory() { …
Michael Draper
  • 1,778
  • 3
  • 16
  • 21
24
votes
1 answer

ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context

I am using jdish.publish in my web app and jedis.subscribe in my desktop app. so both are separate app. I have this pubsub class public class RedisNewPostListener extends JedisPubSub { private final Jedis jedis; private final AppInstances…
Manish Kumar
  • 9,298
  • 16
  • 72
  • 128
24
votes
2 answers

Jedis and Lettuce async abilities

I am using redis with Akka so I need no blocking calls. Lettuce has async-future call built into it. But Jedis is the recommended client by Redis. Can someone tell me if I am using both of them the right way. If so which one is better. JEDIS I am…
cykopath
  • 645
  • 1
  • 7
  • 23
23
votes
2 answers

Using ShardedJedis with RedisTemplate

Following is Jedis documentation directly copied from jedis github page: List shards = new ArrayList(); JedisShardInfo si = new JedisShardInfo("localhost", 6379); si.setPassword("foobared"); shards.add(si); si = new…
hrishikeshp19
  • 7,748
  • 21
  • 73
  • 135
22
votes
2 answers

Redis performance on a multi core CPU

I am looking around redis to provide me an intermediate cache storage with a lot of computation around set operations like intersection and union. I have looked at the redis website, and found that the redis is not designed for a multi-core CPU. My…
Love Hasija
  • 2,458
  • 2
  • 23
  • 24
20
votes
5 answers

How to use java object as a value in Redis

I am pretty new to Redis. I downloaded Jedis and added that to my classpath. But, it doesnt provide a way to store java object as "value" Am i missing something or Jedis doesn't provide the way to store java object as value? Thanks, -Venkat
Venkat Teki
  • 1,163
  • 3
  • 12
  • 25
20
votes
4 answers

How to use SCAN commands in Jedis

I was using redis and jedis for quite some time and never needed the SCAN commands so far. Now however I need to use the SCAN commands, particularly hscan. I understand how it works on the redis level, but the jedis Java wrapper side is confusing to…
luksch
  • 10,564
  • 5
  • 32
  • 48
19
votes
2 answers

Can Jedis get/set an Java POJO?

I'm using Jedis as the java client to connect to Redis Servers. Question 1: It seems there is no method to get/set Object < ? extends Serializable> ? All the values must be String or byte[]? Other clients like "JRedis" and Spymemcache(for…
hongtium
  • 445
  • 1
  • 3
  • 8
17
votes
3 answers

How to setup a connection to Redis Sentinel using Jedis library?

How do I setup a connection to a Redis Sentinel server/cluster using the Jedis library?
ERNESTO ARROYO RON
  • 922
  • 1
  • 8
  • 21
16
votes
2 answers

Get Set value from Redis using RedisTemplate

I am able to retrieve values from Redis using Jedis: public static void main(String[] args) { Jedis jedis = new Jedis(HOST, PORT); jedis.connect(); Set set = jedis.smembers(KEY); for (String s : set) { …
Zeeshan
  • 9,465
  • 14
  • 65
  • 93
16
votes
2 answers

Redis Key expire notification with Jedis

I am trying to implement a expiry key notification with redis ,when my key expires in the redis data store. The redis website provides some description of how http://redis.io/topics/notifications, but Im unable to find any example how to do it using…
Rocky Ray
  • 237
  • 1
  • 3
  • 8
1
2 3
48 49