Questions tagged [spring-data-redis]

Spring Data Redis, part of the larger Spring Data family, provides easy configuration and access to Redis from Spring applications. It offers both low-level and high-level abstractions for interacting with the store, freeing the user from infrastructural concerns.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Spring boot + redis - request takes around same amount of time after restart

I have implemented Redis in my spring boot app using the following CacheConfig public RedisCacheConfiguration cacheConfiguration() { return RedisCacheConfiguration.defaultCacheConfig() ...
arohiman's user avatar
0 votes
0 answers
7 views

Is it possible to find keys which are on different shards using Lettuce using spring data redis

I am using spring data redis in my api. I am trying run the following command through java : Set<String> union = redisTemplate.opsForSet().union(ids); which is causing CROSSSLOT Keys in request ...
Sukh's user avatar
  • 414
0 votes
0 answers
13 views

Getting org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [byte]

I am using spring boot + redis database + 'org.springframework.boot:spring-boot-starter-data-redis' in my project. My repo class has this method accountRepository.findAllByBankId(bankIds) here bankIds ...
Sukh's user avatar
  • 414
0 votes
0 answers
11 views

GenericJackson2JsonRedisSerializer and 'Type id handling not implemented for type' error

I am using GenericJackson2JsonRedisSerializer for reading and writing data in Redis and it works great for most part. However I have a special case where I want to store one of the object as just ...
Mark1234's user avatar
  • 589
0 votes
0 answers
18 views

Spring boot session management for login using redis

How to use redis for session management as i am trying to make an ecommerce website using reactjs and springboot. I need my login to be maintained when page reloads that is why I am trying using redis ...
drax0062's user avatar
0 votes
0 answers
23 views

Redis Connection Timeout

I am using spring boot to connect to redis (docker) if i am running redis on default port I can access from my application, but if I used different port (6382) i am getting timeout although I have the ...
user3586286's user avatar
0 votes
0 answers
12 views

In a Redis cluster how do I determine the peak memory usage of all nodes using Spring Data Redis Reactive API?

I wanted to build an L2 Hibernate Cache using a Redis cluster in Spring Boot (I've done that part already) but I want it to stop using Redis when a certain threshold is reached. So I was thinking of ...
Archimedes Trajano's user avatar
0 votes
2 answers
38 views

How Do Microservices Know Redis Keys To Use To Access Data In Redis

I have been googling a lot concerning how microservices access a redis data but no luck finding good tutorials. Here is my use case. A user logs into the authentication microservice A (spring boot) ...
Eddy Freeman's user avatar
  • 3,207
0 votes
0 answers
37 views

RedisCommandTimeoutException: Command timed out after 1 minute(s)

I have a problem with my project. I'm currently migrating jedis to lettuce using redis list, and in my project I'm also using redis stream. I have a problem, when my code executes this line: this....
Maxence Perronie's user avatar
1 vote
0 answers
30 views

How I fix it ? NullPointerException at org.springframework.data.redis.support.atomic.RedisAtomicLong.incrementAndGet(RedisAtomicLong.java:283)

Could you please help me know what situations could lead to this error? error log java.lang.NullPointerException: null at org.springframework.data.redis.support.atomic.RedisAtomicLong....
rola shi's user avatar
3 votes
2 answers
131 views

Unable to get collection from Redis cache

We are using Redis cache for storing data in cache in our application. We are directly using @Cacheable to allow caching and using redis underneath to cache. Below is the config Redis Config - @...
Neil's user avatar
  • 464
0 votes
1 answer
24 views

RediSearch - Get the JSON objects sorted in the same way after update of any field

I have created an index on RediSearch that includes multiple fields, for example param1 and param2. I perform the search using FT.SEARCH executing the following command. FT.SEARCH "index" &...
Lejdi Prifti's user avatar
0 votes
1 answer
25 views

Does Lettuce work synchronously by default? (Spring Data Redis)

Lettuce github: https://github.com/lettuce-io/lettuce-core/issues/1085 1 “Spring Data Redis uses Lettuce’s synchronous and reactive API.” it says Does that mean it works basically synchronously? I ...
firefly_0's user avatar
0 votes
1 answer
24 views

In Spring Data Redis, can the keyspace be dynamic?

I know that a @RedisHash aggregate root object can use a custom keyspace via a property on the @RedisHash annotation. My question is, how can I dynamically define the keyspace for a class of objects ...
E-Riz's user avatar
  • 31.5k
0 votes
0 answers
25 views

Spring boot starter and redis cluster issue

I deployed a redis cluster using the bitnami/redis-cluster chart. I also set a password TEST. This created a service redis-cluster which maps to all the nodes kubectl get service NAME ...
user3908406's user avatar
  • 1,425
0 votes
0 answers
28 views

Spring data redis storing maps that has complex data as values

I'm trying to store objects of the following class in redis using spring data. public abstract class MyClass implements Serializable { @Id private String id; private Int count; ...
angz's user avatar
  • 129
0 votes
0 answers
19 views

Application ignores management.health.redis.enabled property

I am using Springboot 3. Actuator version is 3.1.1. I have redis dependencies. However I do not want to check the redis health in my lower environment. I tried setting management.health.redis.enabled=...
np10's user avatar
  • 119
0 votes
0 answers
18 views

My KeyspaceEventMessageListener doHandleMessage doesn't get called when I run springboot app using nohup

I have written a Springboot application implementing CommandLineRunner. In that, I have written my custom listener class ListOpsPushEventMessageListener extends KeyspaceEventMessageListener and ...
Venkatesh's user avatar
0 votes
0 answers
28 views

Unable to connect to GCP Redis Memory store from Cloud run spring boot application - although VPC is configured and both are created in same region

I am unable to connect to Google Cloud (GCP) Memory Instance - Redis instance (6.X or 7.X) using the IP and PORT from cloud run developed on Spring boot (3.1.0). Below is the error: Error from Logs ...
Sai Krishna Yamanuri's user avatar
0 votes
0 answers
21 views

Spring statemachine redis - configure ttl

I'm using spring statemachine in my spring boot application. In this application I have configured redis as StateMachineRuntimePersister in this way: @Bean public StateMachineRuntimePersister<?, ?, ...
hamed's user avatar
  • 7,949
1 vote
2 answers
48 views

Will my (Open Policy Architecture) OPA architecture work for microservice authorization?

I am planning to use OPA for Authorizations in microservice architecture. Initially i thought of Sidecar option, but it seams little complex and decided to start with centralized authorization service ...
Jeevika's user avatar
  • 155
0 votes
1 answer
136 views

Spring Boot 3: Unable to gracefully fail and recover on Redis connection issue

I have a spring boot API which is using Redis. I'm trying to cover cases whereby when Redis goes down for whatever reason I am able to handle it and more importantly recover and serve from cache again....
MetaCoder's user avatar
  • 368
0 votes
0 answers
17 views

How to handle data loss in Redis Pub/Sub when using socket connection?

I have a Spring Boot application that uses Redis Pub/Sub to publish data from one service to another service, which then sends the data to a driver app using a socket connection. The problem is that ...
Robert Sahayaraj's user avatar
0 votes
0 answers
15 views

How to publish message dynamically to channel(my custom domain) in pub/sub with spring data redis

In my RedisMessageListenerContainer I have registered the channel like below. Both publish message to that specific and subscribe are working good. But I need to publish message dynamically to my ...
Naga Syamala's user avatar
0 votes
0 answers
27 views

Camel route just echoing the message from controller Redis GET and SET commands not working

I am trying to perform GET and SET operations in REDIS using camel route. Below is my camel context, Not getting any error but route just echoing whatever input i am giving. <camelContext xmlns=&...
Yuvarani Anandhu's user avatar
0 votes
0 answers
13 views

While getting Expired key on the Redis Listener unnecessary prefix is coming as Prefix?

�� t 677_BC getting this in the message but expected is 677_BC public void onMessage(Message message, byte[] pattern) { String channel = new String(message.getChannel()); String body = new ...
Ranjith S's user avatar
0 votes
0 answers
37 views

Redis-sorted set to return the values for all keys in the sorted sets in Java

I have Redis sorted set with key:ID and score: timestamp, and for that sorted set there is a hash with key:ID and all the other key:value pairs from a json object. I need to return the key:value pairs ...
Biljana's user avatar
0 votes
0 answers
19 views

How to get the data from Redis cache based on the matcher of the hashKey using spring framework redis

I have created a cache data with below sample data and am using put operation: void put(H key, HK hashKey, HV value); here h refers to postId which is randomly genearted, HK refers to combination of ...
Sriram's user avatar
  • 101
0 votes
1 answer
55 views

@EnableRedisRepositories not working and gives error: Failed to read candidate component class

I am trying to integrate Redis into my spring web application but getting a lot of challenges. As I want to use Redis through the spring repository so add a @EnableRedisRepositories in the Redis ...
user565's user avatar
  • 891
0 votes
1 answer
71 views

'JedisConnectionFactory' threw exception; nested exception is java.lang.NoSuchMethodError

I am trying to use Redis in my spring web project but getting some conflict. I am using the following jar in my pom: <dependency> <groupId>org.springframework.data</groupId> &...
user565's user avatar
  • 891
0 votes
1 answer
91 views

The RedisCommandExecutionException, while Spring Data Redis execute CONFIG, GET command in the Redis server

I have a Spring Boot 3 based project. Which uses the Ridis server as DB. It is a simple project and everything is auto-configured by spring-boot-starter-data-redis module The entity: @Data @...
dred dred's user avatar
  • 130
0 votes
0 answers
46 views

Redis envoy proxy

I tried to set up Redis as an Envoy proxy from this example https://github.com/envoyproxy/envoy/tree/main/examples/redis. The problem is it does not support some commands like HELLO and INFO in Spring ...
Iman Ahrari's user avatar
0 votes
0 answers
68 views

redisson-spring-boot-starter - TTL issue when Cache is created using RedissonSpringCacheManager

In a simple spring boot starter web project, I am using redisson-spring-boot-starter. I have enabled caching by @EnableCaching on my Spring boot application class. I have configured a cache with TTL ...
Vishal Upadhyay's user avatar
0 votes
0 answers
46 views

How to connect to master and replica using spring data redis 2.0.4 with java 8

We are migrating from redis cache to redis with elastic cache. We have two apps on java8. One app is spring boot(2.0.0) with java 8 and other one is a spring app with java 8. They both need to share ...
Naga Syamala's user avatar
0 votes
1 answer
114 views

CROSSSLOT Keys Error with Redis Cluster-Mode Enabled in springboot using Lettuce Configuration

We just moved from redis standalone to cluster and we came across the following Exception: RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ...
Chaithra Rai's user avatar
0 votes
0 answers
23 views

Does @RedisHash TTL works with RedisTemplate directly?

I read several articles/example from Internet, and I'm understand that @RedisHash annotation is always used together with CRUDRepository. I'm currently want to use the TimeToLive feature that provided ...
xiaoli's user avatar
  • 137
0 votes
0 answers
233 views

Spring Boot Redis - Lettuce is not creating connection pool

I am using spring-boot-starter-cache for redis interaction and below is the code which I am using to intialize the configurations : @Autowired private LettuceConfigProperties ...
Ajay Pilaniya's user avatar
0 votes
0 answers
51 views

Is there a way to use Redis in a Spring Boot App without configuring any Redis clients

I have read some articles and in them Jedis or Lettuce client is used to connect and to configure Redis but I have found another article (https://www.baeldung.com/spring-boot-redis-cache) which says &...
Spandan Rastogi's user avatar
0 votes
1 answer
48 views

JedisClientConfigurationBuilder - JedisClientConfiguration - how to turn on ssl and usepooling both in JedisConnectionFactory

In spring JedisClientConfigurationBuilder interface , there are 2 methods, JedisSslClientConfigurationBuilder useSsl(); JedisPoolingClientConfigurationBuilder usePooling(); I am able ...
harshit2811's user avatar
0 votes
1 answer
21 views

Is there a way to handle redis timeouts and not to fail the API if redis is unavailable

For my API , I am using redis cache , sometimes while calling redis we get exceptions like timeout because of which the API fails even though the data is present in redis and in database. Is there any ...
developer's user avatar
0 votes
0 answers
60 views

Issue with Spring Boot 3 Spring Session: @EnableRedisIndexedHttpSession annotation sets the default value for Redis namespace

When I tried to use Redis indexing to solve the issue of concurrent control in Spring Security session clustering, I noticed that after adding the @EnableRedisIndexedHttpSession annotation, Spring ...
Blues's user avatar
  • 1
0 votes
0 answers
28 views

What is the RedisCacheManager.setExpires() equivalent in spring-data-redis 2.x

I'm in the process of migrating my spring MVC project from spring 4 to spring 5. As a part of that task, I'm trying to upgrade spring-data-redis 1.8.13.RELEASE to 2.7.12. Spring Cache Configuration ...
Vinura Selaka Pathiraja's user avatar
0 votes
0 answers
113 views

how to create new connection with redis on each request with username and password using spring data redis?

I am using spring data redis to connect to standalone redis. I am using LettuceConnectionFactory to create initial connection with redis with default user but after connection has been established I ...
Roshan Jha's user avatar
0 votes
1 answer
93 views

Is there a way to prevent `spring-data-redis` from index nested properties of a particular entity field

Problem I am trying to save an entity that has a field of type javax.money.MonetaryAmount to Redis using spring-data-redis: @RedisHash("transaction") class Transaction( @org....
W.K.S's user avatar
  • 9,807
0 votes
1 answer
92 views

Spring Data Redis. JPA Repository findBy is not working

I'm using spring-data-redis 2.7.5 version. Object declaration: @Data @AllArgsConstructor @NoArgsConstructor @Getter @Setter @ToString @RedisHash("Applications") ...
Biljana's user avatar
0 votes
0 answers
32 views

Error creating bean with name 'redisMessageListenerContainer' : Container already initialized

I was trying to upgrade the Spring Boot version of my project which was earlier running on version 2.4.13, to version 3.1.1. I have used Redis as a pub/sub in my project and the current version for ...
Shivangi Sharma's user avatar
1 vote
3 answers
64 views

Resetting TTL if key is accessed in redis

I have class which I am using to use in redis with some TTL associated with every object. Many time some of the object needed to be access beyond ttl, In other words we want the ttl timer to be reset ...
dead programmer's user avatar
0 votes
1 answer
411 views

use multiple redis configuration spring boot

i need two redis configuration one for my tokens and one for my invoices then i need to use them in different middlewares or controllers here its my InvoiceRedisConfiguration @Configuration public ...
Masoud Niki's user avatar
0 votes
0 answers
21 views

I have nested key like MainKey-SubKey1-Subkey2-Subkey3 = value

ex: Main Key M1 ,Sub Key s1 ,s2 and s3 My data is like M1 s1-s2-s3 =value1 M1-S1-S2 = Value2 ``M1-S1 = Value3 M1 = Value4 Output expectations: If I request with Key M1 all 4 values value1..4 should be ...
Vratik Pathak's user avatar
0 votes
0 answers
76 views

Redis Expiry Key Event generates twice for same key

Hi Im new to redis expiry key events. In local notifications are generated once only for different keys expiration. I have 3 keys to expire at different time. But problem is Message Listener gets two ...
Rahul More's user avatar

1
2 3 4 5
21