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.
883
questions
0
votes
0
answers
18
views
Redis query by entities by elements of a list / key of of a map property
I am currently working on a project where we have the ability to switch between which database we are storing a given entity based on how long we want to store the data, we are using MongoDB for long-...
0
votes
0
answers
31
views
spring data jpa - hibernate second level cache without @QueryHints
I'm using spring data jpa in my spring boot application and I need to enable hibernate second level cache for caching some entities. I use Redis as cache server for my app and so I need to use ...
0
votes
0
answers
11
views
RedisConnectionException escapes
we get RedisConnectionException and need to retry on them.
We are using Spring Data Redis with lettuce client, we have a config like:
var lettuceClientConfigurationBuilder =
...
-5
votes
0
answers
28
views
What does this generic definition in Java mean? [closed]
First, the execute method of the RedisTemplate accepts a RedisOperations. The interface for RedisOperations is defined as follows.
RedisTeplate.execute
SessionCallback
In my code I provide an object ...
0
votes
0
answers
17
views
How does spring-data-redis get an objectRecord with a Generic type
I want to implement MQ using stream in Redis, and when the entity type passed is generic, my code does not deserialize the entity consumption message correctly.
producer critical code:
@Bean
...
0
votes
0
answers
9
views
Why are Hash Converters of redis repository so slow?
I would like to know why the classes that are in charge of converting an object to a redis hash are so slow.
In particular I have tried to use these 2 classes with StringRedisTemplate:
private final ...
0
votes
0
answers
18
views
How to use embeded redis in kubernetes cluster..?
I want to run embeded redis with spring boot application in kubernetes cluster but it is not creating any container with embeded redis.
Getting error: CRASH LOOP BACKOFF.
apiVersion: apps/v1
kind: ...
0
votes
2
answers
40
views
Spring Data Redis not importing correctly
I'm currently working on a project that requires me to use Spring Data Redis. However, I can't seem to get it working, because if I do an import of org.springframework.data, it doesn't recognize the ....
0
votes
1
answer
35
views
Springboot with Redis Sentinals getting UnsatisfiedDependencyException
I am not able to connect with Redis Sentinal nodes using Spring boot. I am getting UnsatisfiedDependencyException while creating bean cacheManager and localCacheManager. I am not getting where I am ...
0
votes
0
answers
23
views
Getting NullPointerException from message listener container, while staring spring boot application
I am getting following error with my Spring boot application:
Exception in thread "custom-message_listener-container-2" java.lang.NullPointerException
at redis.clients.jedis....
0
votes
0
answers
27
views
Spring Boot ReactiveRedisOperations Deserialize to Wrong Object
i am trying to get data from redis. then when deserializes getting error
"Could not read JSON: Cannot deserialize instance of `com.xxxxx.adapters.output.cache.redis.data.flightdetail....
0
votes
2
answers
55
views
Spring Session with Redis - keys are not getting expired in Redis
I am new to spring-data-redis. I have integrated with a spring-boot application. As part of this, I have added a few configs as follows:
spring.session.store-type=redis
spring.session.redis.namespace=...
0
votes
0
answers
51
views
Is java's setIfAbsent(K,V, ExpiryTimeout) in redis atomic?
According to the documentation, spring data redis's setIfAbsent(K, V) uses setNX command. However, setIfAbsent(K, V, Expiry timeout) seems to use set command, instead of setNX. Does it mean that ...
0
votes
0
answers
11
views
No qualifying bean of type 'org.springframework.data.redis.support.atomic.RedisAtomicLong' available: expected at least 1 bean as autowire candidate
I have a common library and common library is using redis jar:
package com.service.dao.impl;
RedisImpl.class
@Profile
@Log
@Named
public class RedisImpl implements RedisDao {
...
0
votes
0
answers
23
views
Hot to fetch a set from Redis: Sorted Set of a specific member with above below N ranks?
I have a Sorted Set for storing player-score data on Redis as demonstrated below:
Member
Score
1a2bs3
100
1a2bs4
200
1a2bs5
300
1a2bs6
400
1a2bs7
500
1a2bs8
600
1a2bs9
700
At some point I ...
0
votes
0
answers
26
views
How to override the PipeliningFlushPolicy in LettuceConnectionFactory in Autoconfigure bean present in LettuceConnectionConfiguration
@Bean
@ConditionalOnMissingBean(RedisConnectionFactory.class)
LettuceConnectionFactory redisConnectionFactory(
ObjectProvider<LettuceClientConfigurationBuilderCustomizer> ...
0
votes
0
answers
34
views
Unable to connect to GCP Redis with SSL enabled. Is there any way to pass .Pem Certifcate in spring configs?
currently this is how I am connecting with redis..If someone can let me know how to configure ssl options to use .pem certificate will be very useful
@Bean
LettuceConnectionFactory ...
0
votes
0
answers
76
views
Command execution timeout for command: (AUTH), params: (password masked) - Redisson client
I am trying to connect to redis server using redisson client in spring boot application. While connecting to redis using user name and password, getting the below exception
Command execution timeout ...
0
votes
1
answer
33
views
Redis return null value to id column
I'm write a dataframe to redis and read the data with spring boot application. The information retry successfull, but the id column return null like that:
{
"nu_document": null,
"...
0
votes
1
answer
28
views
Is there a way we can fetch data from Redis Hash in batches using Spring Data Redis?
Actually, we are fetching data from a Redis hash. But as the size of the data in the hash increases with time, a read timeout exception started coming. We are using Jedis as a client to connect to ...
1
vote
0
answers
44
views
How to fetch redis cli set json and fetch from Get Api Spring boot redis?
I want response from redis cli to postman as this
http://localhost:8585/api/home/getBestTrainerBasedRating
[
{
"trainerid": 28,
"rating": 5.0,
"...
0
votes
1
answer
56
views
how to fetch single attribute from redis cache spring boot?
how to fetch a single attribute from Redis cache spring boot?
I want a response like this one
{
"answer": "FHFHFHFHFH"
}
but getting this one Please do let me know what ...
0
votes
0
answers
63
views
Redis Cache - Null key returned for cache operation (maybe you are using named params on classes without debug info?)
I'm using Spring Cache for Redis. I've 2 methods each returns policyTest object but are invoked with different parameters as shown below.
// @Cacheable(value = "policyTest", key = "#...
-1
votes
1
answer
74
views
How to get all the documents from an index in Redisearch?
I am using RediSearch and storing the data in an Index through documents. I want to get all the documents from the Index, please suggest.
0
votes
1
answer
137
views
Does Redis cache have advantage over Spring cache if used only for simple cache?
I am new to caching thing and learning some different solutions for my spring boot app. I was looking at Spring Cache and it is simple caching mechanism (that was what I look for) than I saw redis ...
0
votes
0
answers
25
views
implementing cache on filter apis spring boot
I am working on a spring boot app where I have multiple fetch apis which are basically filter apis taking in params and sending response from db.
Now under load they are acting pretty slow,Is there ...
0
votes
1
answer
33
views
Pop (LPOP, RPOP) multiple keys with one command
I have multiple small queues inside Redis and I want to poll them at a fixed period of time. At the moment I have multiple keys in Redis where each stores a list of strings.
Is there a way to run pop ...
0
votes
1
answer
103
views
How do you add elements to a Redis Hash and set the expiration using ReactiveRedisTemplate without block?
If it wasn't reactive I'd do something like.
/**
* Given a refresh token and the user name, create a "payload" to represent
* secret data and store it into Redis as a hash and set it to ...
0
votes
0
answers
23
views
Listener not getting message in REDIS PubS/ub with Spring Boot
I am relatively new to Redis Pub/Sub. I have integrated this recently in my Spring Boot application.
Redis Pub/Sub configuration is as follows:
@Configuration
public class RedisPubSubConfiguration {
...
1
vote
0
answers
294
views
How to pass username and password to Jedis?
I am trying to use Redis 6.0 ACL with the Sentinel for High Availability. Currently, only Redis servers are configured with usernames and passwords with the help of the ACL feature and there is no ...
0
votes
0
answers
35
views
Redis and postgresql integration
How to write the JSON data to redis first and then to PostgreSQL automatically. And Is it possible to update the data in redis? Any code snippets to automate the data writes from redis to PostgreSQL
1
vote
0
answers
347
views
Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool;
My Spring boot app hosted in AKS Azure, while hitting the redis cache in Azure, getting Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could ...
2
votes
0
answers
849
views
Error: io.lettuce.core.RedisConnectionException Unable to connect to localhost/<unresolved>
I'm trying this tutorial from a book where there's an api running and when the application with the redis code gets called, it's suppose to output the information from the api. However, this is the ...
0
votes
0
answers
32
views
Spring Redis Does Not Delete the Stream Entries
I'm using the Redis Template and I want to delete the entries of the stream after processing it. I used the below code but it didn't delete from the Redis Streams.
redisTemplate.opsForStream().delete(&...
0
votes
1
answer
79
views
way to override @RedisHash value in configuration
I'm using a framework which is based spring-data-redis, and the framework was using @RedisHash to set value the redis key uses. Is there a way to override the value set in @RedisHash?
I'm tring to use ...
1
vote
1
answer
50
views
Redis search not found with composed label
I am trying to query by secondary index in my redis.
When I query the redis with a single label it works, for example:
FT.SEARCH LiveRooms-idx "@numUsers:[100 200]"
But when I query with a ...
0
votes
0
answers
20
views
Stop the test spring from auto requiring the RedisConfiguration?
I have defined a bean for Redis in my Document.xml.
<bean id="redisConfiguration" class="com.project.RedisConfiguration"/>
My tests are failing locally if I don't have a ...
0
votes
0
answers
116
views
How to properly close Redis connection on intentional application shutdown?
We are using the list operations of the RedisTemplate (provided by spring-boot-starter-data-redis) to do a blocking call waiting for new items to arrive in a list within Redis. Since we are not ...
0
votes
0
answers
169
views
Spring Data JPA Redis: Query by multiple values for same key? Query by Example using REGEX not supported
Please let me know if this has been asked before.
I have a requirement to do some advanced filtering on data that is stored in Redis cache. Imagine there are 2 dropdowns which have many values, and ...
0
votes
0
answers
24
views
why spring redis session 'touch' method called in 'cleanExpiredSessions' method can clean expired session
i am chinese,My English is so poor,I try my best to describe my problem clearly
I recently learned about the spring redis session cleaning mechanism,the clean method is 'cleanExpiredSessions' in ...
0
votes
0
answers
93
views
Disable Spring Data Redis TLS verification in application.yml
We're using spring-data-redis and Azure Cache for Redis. When debugging locally, the only way to connect is to use TLS, but disable the peer verification - as I understand it, Azure does something ...
0
votes
0
answers
99
views
How @EnableRedisHttpSession works internally?
I am using @EnableRedisHttpSession in my spring boot application to store my user's session after successful login and it is also working fine.
The problem I am facing is that the key which is ...
0
votes
0
answers
123
views
Redis exception MOVED 8429 10.21.21.117:6379
Received error while fetching Platform And Activate entities:Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MOVED 8429 10.21.21.117:6379
can anyone help me ...
0
votes
0
answers
87
views
java.lang.NoClassDefFoundError: org/springframework/data/redis/core/DefaultBoundSetOperations
I am new in spring session. and want to handle http session of my simple spring MVC project with Redis. I am using following POM
<project xmlns="http://maven.apache.org/POM/4.0.0"
...
0
votes
1
answer
74
views
Springboot docker-compose redis Cannot get Jedis connection;
This may seems as duplicate of docker-compose with springboot and redis and docker-compose redis connection issue but the solutions proposed there are not working in my case.
I am using springboot and ...
0
votes
0
answers
202
views
Spring Redis list entry - save extra call to set TTL with RedisTemplate
I am using RedisTemplate in my Spring application in order to store lists in my Redis server. I would like to set expiration TTL for the keys I insert to Redis. I am using RedisTemplate for pushing ...
0
votes
0
answers
32
views
Unexplained latency with ValueOperations using Jedis
We have Spring Boot web services hosted on AWS. They make frequent calls to a Redis Cluster cache using Jedis.
During load testing, we're seeing increased latency around ValueOperations that we're ...
0
votes
0
answers
90
views
How to maintain consistency in redis while it is used as cache in springboot
Actually, I was doing crud operations on a Postgresql database and Redis is used as cache in spring boot application. While I was performing update operation after find operation if I change something ...
0
votes
1
answer
56
views
Query method not supported - Redis datasource, Spring boot starter data redis (2.6.3) and CRUD repository
I am using redis as my data store and i am using spring boot starter data redis as the dependency and a crud repository for CRUD operation. When i do deleteById it is working. But when i do ...
0
votes
1
answer
169
views
Multiple Redis For Spring Cache And JWT
I have actually an application that is using Redis for Cache and keeping the JWT token into redis.
My goal is to have one redis for cache, and another one for jwt token.
I dont understand how i can ...