How to get only one Redis event when running multiple services?
I have a java application running as a microservice that receives events for keys that expired in Redis (Redis is configured with "config set notify-keyspace-events Ex"). These events are read in the...
View ArticleRedis sort & retrieve elements inside hash
In my application, I'm using redis to store List<Document> in hash objects.class Document { long id; String title; Author author;}class Author { long id; String authorName;}So in redis I've hash...
View ArticleSpring Boot Cache with Redis - How to skip Caching in case of Timeout exception
I've enabled Caching in my Spring Boot app and I use Redis to serve the purpose.My Spring Configuration is:@Configuration@EnableCaching@ConditionalOnProperty(value =...
View ArticleGetting a key/keys from ReactiveRedisOperations always return empty result
I am migrating my traditional Redis cache to the Spring Data Reactive Redis. After migration I would like to test if my new integration works as expected but I faced a problem with getting key/keys...
View ArticleRedis Cache (Redisson Client) not getting updated with DB (Mysql, Hibernate)...
I am able to cache the DB entity, but when I update it and do a get call to the same entity, I receive the stale the entity in response. Am I missing come configuration here?BTW I am trying to...
View ArticleJdkSerializationRedisSerializer in Spring Boot does not change
My objects do not implement serialization and I do not want to rewrite for this. I tried to replace JdkSerializationRedisSerializer with Jackson2JsonRedisSerialize, I have tried many options but it...
View ArticleUnable to cast the Object to Entity Type
I am trying to use Redis Cache to improve the performance of our application. I am referring this article for my implementation. I am getting this exception:class com.entity.UserEntity cannot be cast...
View ArticleHow to check null value from REDIS MGET via Jedis client in java
I have some keys in redis. I can do a MGET and fetch the values. But when the key is not present I get a (nil) from redis. But how to check that in java ? I am checking for null but it is not...
View ArticleHow to remove item from Redis sorted set based on json filed
I'm using redis to design user timeline (as in tweeter). I'm using sorted set to store json value with timestamp as score zrange feed:user:10000001 0 10 WITHSCORES 1)...
View Articlehow can i use jpa and redis repositories together?
i know that spring boot provide repository for redisusing @redisHash annotation and implementing crud repository like a jpa repository@RedisHash("example")public class RedisEntity { @Id @GeneratedValue...
View ArticleRedis xlclaim returns 1 claimed, yet is not really claimed, xpending still...
So, i am using Java to do this, but essentially, and I can see it in the debugger, I end up in a stackoverflow (here too) due to a claim not really being claimed despite it saying it does.I call...
View Articlehow can i store redis value not address in class
i am using redis Repository@RedisHash@Data@Builderpublic class CustomClass<String,T> { @Id String id; T data;}when i saved data using crud Repositoryi found that there is a class name not data...
View ArticleSpring cloud gateway redis rate limiter add X-ratelimiter-reset (time to...
I have seen that is standard to send a X-Rate-Limit-Reset header that contains the time in milliseconds for the rate limiter to refill tokens of a bucket so the client can execute some logic (i.e. not...
View ArticleCustom Spring RedisHash with multiple IDs for a parametrized key
I have some Redis hash keys which are defined as Class:<class_id>:Student:<student_id>. I'm having trouble defining this parametrized RedisHash in Springboot for keys like this. So far I've...
View ArticleHow to Make Subscribers Not Consuming The Same Messages - Redis Pubsub...
So recently I was exploring on how to make a client app utilising Redis PubSub feature and make it resemble Apache Kafka messaging. I know that those two have their own characteristics, therefore I...
View ArticleRedis - Consider renaming one of the beans or enabling overriding by setting...
I am developing Spring Boot + Spring Data Redis example. In this example, I'm developing the code for the RedisMessageListenerContainer and define the corresponding bean here.Now when I run the...
View ArticleSpring Data Redis: Failed to convert from type...
I've been struggling with this exception from Spring Redis Streams when I try to convert a message from the Stream to my entity. I believe it is occurring due to an issue with the Redis Stream's...
View ArticleApache Spark Redis Stream Java Example giving...
I am trying to implement a Apache Spark Streaming job reading from Redis Stream. I am getting the below error:java.io.NotSerializableException: java.util.ArrayList$Itr at...
View ArticleSpring dependency injection not finding repository bean after adding...
I have this spring boot project (version 2.3.3.RELEASE) that uses Spring Webflux and Spring Data and R2DBC. It was working fine until I added the following dependency:implementation...
View ArticleSpring Data Redis repository won't work with queries with Lists
I have been trying to use Spring Data Redis but it fails for queries with List in them and just won't work. I tested it with normal fields such as ID and it works fine without issues, would appreciate...
View Article