Redis command timed out; nested exception is...
Today when I using Java redis client(spring-data-redis-2.3.9.RELEASE.jar) to consume Redis stream message encount this error:2021-05-11 17:49:42.134 ERROR 26301 --- [-post-service-1]...
View ArticleHow to use composite key as id in spring redis entity as equivalent to...
I am using a spring data redis repository for retrieval and persistence into Redis. But I need the id to be composite of 2 fields.How can this be achieved? Is there any way equivalent to @EmbeddedId?
View ArticleSpringboot Redis not save in cache if return value is false
I need to save this cache once response is true only.If it is false then no need to save it in the cache.@Cacheable(value = RedisCacheConfig.CONFIGURATION_CACHE, key =...
View Articleclass file for redis.clients.jedis.JedisShardInfo not found
when I upgrade the jedis to version 4.2.3 in gradle.build: api "redis.clients:jedis:4.2.3"show...
View ArticleRedis Dynamic Topic Subscription
Currently, I am using Redis as pub/sub and using jedis client. I am subscribing to topic device/{deviceId}/{parameterId}I want to read the values of deviceId and parameterId from the topic.I...
View ArticleTwo levels of cache (Redis + Caffeine)
When profiling an application it came up that Redis is impacting the execution times because there are many sleeps in threads. I need to implement two levels of cache or think about solution of this...
View ArticleSpring Boot Caching with Redis Sentinel always connects to master node
I have a Spring Boot (2.3.1.RELEASE) app that has caching with Redis Sentinel.This is my configuration for the Sentinel connection:@Beanpublic LettuceConnectionFactory redisConnectionFactory() {...
View ArticleWhat are the notify-keyspace-events in Redis
I started to setup spring project by following this spring-boot article. But suddenly application could not start successfully, instead I am getting the following stack trace:Exception in thread "main"...
View ArticleUnable to store copyright symbol in Redis cache and Postgres DB through Java JPA
I have a scenario where I am reading a JSON file which contains a text(Copyright © 2022) that contains copyright symbol. I am reading this file from AWS S3 and storing in StringBuilder for processing....
View ArticleRedis StreamMessageListenerContainer dont reconnect on redis server restart
I have implemented StreamMessageListenerContainer to consume and process message from Redis Stream.I am using Lettuce Connection factory.While my application is deployed, I restart Redis server and my...
View ArticleHow to implement dynamic counter in Redis?
Recently, I need to query the cumulative times, amount, and days of transactions in a single week and within 7 days.Here is an example to explain my demend. Suppose there is an user u0001, his...
View ArticleDoes the spring-data-redis pipelining executePipelined method guarantee an...
Does the Spring data redis executePipelined method guarantee the order of results?Example:final List<Object> objects = redisLongOps.executePipelined(new SessionCallback<>() { @Override...
View ArticleHow to identify if Redis is down or if it is running?
I am using redis as a cache in one of my spring boot java application. I am performing only get operation on this redis instance from a scheduler code which runs every 30 seconds and write operation is...
View ArticleNoClassDefFound is thrown on attempt to create JedisConnectionFactory
I have generated a brand new springboot project using SpringInitializr in my IntellijIDEA (v.2022.2.1). As a result I got pom.xml like this:<?xml version="1.0" encoding="UTF-8"?><project...
View ArticleRedis key expiry event in spring?
I have a key that expires after 30 seconds.redisTemplate.expire(sessionId , 30, TimeUnit.SECONDS);This is my listener:@Servicepublic class RedisController implements MessageListener { @Override public...
View ArticleMigrating spring-boot-redis and Jedis to use Jedis 4.2
I have an application running older version of Spring Boot and Jedis, and would wish to upgrade to more recent versions so 2.7.3. for org.springframework.boot.spring-boot-starter-data-redis and 4.2.3...
View ArticleHow does RedisCacheManager and Redis manage cache names?
How does Redis manage cache names as used by the getCache("name") method in the org.springframework.cache.CacheManager interface that belongs to the Spring Framework?I have done a few tests here and...
View ArticleI am getting the following error when using redis with spring boot [closed]
Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration and...
View ArticleImplement maxIdle timout session using Redis
Like Spring Session with Redis persistence, how to achieve max idle timeout using Redis as cache? I need to have both global timeout and max inactive timeout. The global timeout can be achieved using...
View Article(lettuce) READONLY You can't write against a read only slave
I need some help, Our service uses the lettuce 5.1.6 version, and a total of 22 docker nodes are deployed.Whenever the service is deployed, several docker nodes will appear ERROR: READONLY You can't...
View Article