Skip to content
Advertisement

Tag: redis

Collection Object lost due to redis TTL using redission client

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

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

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

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

Advertisement