Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Browsing all 2231 articles
Browse latest View live
↧

Should it call method hasKey before get when use redis or other DB

When I want to get data form Redis, I was confused about that whether or not call method redis.hasKey before redis.get.Someone write like this:if (redis.hasKey('xxx')) { return redis.get('xxx');}return...

View Article


Redis Connection Issue with jedis

I am using this code but getting connection issue:JedisConnectionFactory jedisConnectionFactory() { JedisConnectionFactory jedisConnectionFactory = null; try { RedisStandaloneConfiguration...

View Article


How to stop vertx threads?

So here's the situation: I'm implementing the caching of our webapp using vertx-redis (we were formerly using lettuce). Pretty simple mechanism, there is an anotation we use on endpoints which is...

View Article

Better Performance hget vs get || Using Redis

Better Performance hget vs get || Using Redis1>hset key field value ---Here field("dept") will always be same(constant) and key could be 20 charhset "user1""dept" 1hset "user2""dept" 2hset...

View Article

Using same Redis Cache for Inserting different Type Of Objects

Is it possible and right way to use same Redis cache for storing different type of objects? I know it supports multiple DS. In my scenario that object will be user defined objects. Moreover there will...

View Article


Spring Boot Redis error when dockerized, but not with maven run

I am building an application with Spring Boot using Redis (with redisson).When I run my application in development mode, it works fine, but when I try to run it in docker containers, it fails with the...

View Article

Unable to connect to Jedis in AndroidStudio (Java)

My apllication is crushing when I press the button which is responsible for connecting to Redis database using Jedis client and changing TextView to value which stores jedis.ping() (It should return...

View Article

converting byte array to double in lua

Redis (a key-value store) supports lua scripts - it executes the script on the server. I am interacting with Redis using a java client. I am passing a byte array to lua and in lua, I would have to...

View Article


How to clear records from Redis Stream, left only N newest ones?

I have SpringBoot app where microservices send and receive some data from redis stream. So, every service send record which is Map:StringRedisTemplate redisTemplate = new...

View Article


How to convert Java Hashmap Hierarchy to its equivalent in Redis Cache?

I have the following Job class representing runs of a job. I have a list of start and end times in Job class because the same Job can be rerun. public class Job { private final List<Timestamp>...

View Article

How to connect to a Docker Redis cluster instance using jedis for Java?

I have created a cluster of 6 nodes using redis docker-compose (3 master and 3 slave) and also linked all of them.cluster...

View Article

Mock redis template

I am facing a issue in mock redis template.Can any one help me to write unit test for below class.@Repositorypublic class CasheRepo { @Autowired private RedisTemplate<String, Object> template;...

View Article

Redis PubSub Reconnect with Jedis

Trying to include the code related to azure redis autoreconnect if any network error occurred in Redis PubSub connection. Any help/advice would be appreciable. Below is my Redis Config code. public...

View Article


Spring Data Redis Expire Key

I have a One Spring Hibernate Application. In my application, Recently i am implemented Spring data Redis.spring-servlet.xml<!-- redis connection factory --><bean id="jedisConnFactory"...

View Article

Spring nested @CacheEvict

Suppose I have these two classes:public class A implements Serializable { ... public B b; public String name;}public class B implements Serializable { ... public int value;}And I have two...

View Article


Caching selected hibernate entities in Redis Cache without using Redis as...

We already have ehcache as a Hibernate second level cache. I want to maintain a remote cache for the entities which are less frequently updated, but any update need to be reflected quickly on all...

View Article

How to add a list to a redis list? [closed]

I have to add a list to an exsiting list in Redis,for adding to redis list action is happening synchroniselly, if add element to list one by one, the sequence of a complete list will be...

View Article


Redis ErrnoException in running server

I am getting Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)when trying to connect to my redis server in AndroidStudio. Server has already been started...

View Article

Write many, ready many data store?

I have an application that does over 10,000 TPS. I'd like to do 3 things. I check if the key exists in our data structure, if it does then I grab that key and the data associated with it and push it in...

View Article

How compareAndSet works internally in redis

spring-data-redis module contains RedisAtomicLong class.In this class you can see public boolean compareAndSet(long expect, long update) { return generalOps.execute(new SessionCallback<Boolean>()...

View Article
Browsing all 2231 articles
Browse latest View live