We are using Redission client for java to get the data from redis but object gets deleted from collection due to TTL. Example We are trying the below approach to get the data from Redis with TTL. final RList rList = client.getList(getEnvCacheKey(cacheKey)); rList.expire(7L, TimeUnit.SECONDS); rlist.add(“Value1”); rlist.add(“Value2”); assertThat(rList).containsOnly(“Value1”, “Value2”); // This condition is true until 7 seconds Now after 7 seconds
Tag: redis
How to pass ipv6 address in Redis connection
I am using Redisclient as following. But it gives error as “Host name cannot be null”. What is wrong in above code? Answer It needed square brackets around ipv6 address as following.
Java – Spring Boot – Reactive Redis Stream ( TEXT_EVENT_STREAM_VALUE )
I want to write an endpoint which always shows the newest messages of a redis stream (reactive). The entities look like this {‘key’ : ‘some_key’, ‘status’ : ‘some_string’}. So I would like to have the following result: Page is called, content would be for instance displaying an entity: the page is not closed Then a new entity is added to
Dependency error in Spring boot for Spring session and Redis. What is the correct dependency i have to use?
I have angular 2 front-end and spring boot back-end.I want to use username and password for login and then use x-auth-token to check session for each request sent from angular.I want to use Redis to store session.But i keep getting the below error when connecting to Redis.My assumption is my dependency version of spring session is causing the issue but
How to use Redis as L2 cache on Hibernate?
I have a spring boot application and need to setup Redis as l2 cache on hibernate. My prop file looks like: I created a custom region factory because I don’t want to use json or yaml files. (right now, the parameters are hardcoded). CustomRegionFactory class looks like: Using redis-cli I found out that all my entities annotated with @Cacheable are
Make Redis as optional
I am using spring boot with Redis.Redis is running as Docker container Redis is a memory DB, if it finds data in Redis based on the key, it retrieved from Redis otherwise go into actual db call. when Redis is running, code works fine. but sometimes for any reason, if Redis is down, I am getting exception RedisConnectionException: Unable to
Access Redis connection pool using Spring Data Redis
I want to monitor and periodically log information about the Redis Connection Pool usage. I use Redis through spring-data-redis RedisTemplate object. Is there any way to access pool? Answer I was able to access internal pool using reflection API.
Read data saved by spark redis using Java
I using spark-redis to save Dataset to Redis. Then I read this data by using Spring data redis: This object I save to redis: Save object by using spark-redis: Repository: I can’t read this data have been saved in Redis by using Spring data redis because structure data saved by spark-redis and spring data redis not same (I checked value
Redisson RRingBuffer capacity cannot be changed dynamically under the same key
currently I’m working on software where I would like to use Redis to store some data. Specifically, I would like to use the RRingBuffer where I initially set capacity and it can change during the runtime. My idea was that a new RB is created and the data from oldRB is moved to newRB For example, maybe this is wrong:
How can I store nested Hashmap in Redis?
I want to store netsted HashMap in Redis having single key. For example : Please Suggest : Is there any way to store the above-mentioned data structure? How can we achieve this? Answer Redis doesn’t support it as of now. However there is a way to do it, other than rejson. You can convert it into JSON and store in