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.

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.

Features

  • Abstraction across multiple Redis drivers/connectors such as Lettuce and Jedis.
  • JDK, String, JSON and Spring Object/XML mapping serializers.
  • Spring cache abstraction for use with Redis.
  • JDK Collection implementation on top of Redis.
  • Pub/Sub integration.
  • Reactive and imperative APIs.

Online Resources:

Version History

1029 questions
8
votes
3 answers

Configure a new serializer for spring-boot redis cache config

I have been trying to change the default serializer for the spring-boot redis cache because i want to change from the Default to one of the Jackson2Json implementations. There are two implementations from the Jackson2Json library one of them is the:…
krionz
  • 417
  • 1
  • 4
  • 15
8
votes
1 answer

Redis client Lettuce command timeout versus socket timeout

We have defined Lettuce client connection factory to be able to connect to Redis defining custom socket and command timeout: @Bean LettuceConnectionFactory lettuceConnectionFactory() { final SocketOptions socketOptions =…
CRISTIAN ROMERO MATESANZ
  • 1,502
  • 3
  • 14
  • 26
8
votes
1 answer

spring data redis with lettuce connection pool configuration

We are upgrading from spring boot version 1.5.2 to 2.0.0. I have found that spring data redis is using lettuce as default and requires no connection pool management and uses only single underlying tcp connection. We also use ConcurrentMetadatStore…
8
votes
1 answer

How to connect Redis with sentinels in docker?

I setup a Redis master/slaves/sentinels from docker, and this is my docker-compose.yml redis-master: image: redis:3 ports: - 6380:6379 redis-slave: image: redis:3 ports: - 6381:6379 command: redis-server --slaveof…
dream83619
  • 621
  • 7
  • 16
8
votes
3 answers

Disable Redis AutoConfig in spring boot when testing

I am trying to disable Redis when I am testing with spring boot. I have disabled my configuration but the auto config created a default connection and fails because it can't connect to a non-existent service. For testing I am content to just use a…
Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76
8
votes
3 answers

Spring Data RedisTemplate, ttl is not working when setting a value

I want to set a ttl for my keys that are stored in Redis, and I have done that in the following way: @Component public class RedisBetgeniusMarketService implements BetgeniusMarketService { private static final int DEFAULT_EVENTS_LIFE_TIME =…
Hutsul
  • 1,535
  • 4
  • 31
  • 51
7
votes
2 answers

Lettuce can't connect to Redis Cluster using SSL but can connect to same Redis server using SSL by treating it as a Standalone node

I've an Azure Cache for Redis - Premium and Cluster enabled. I've been trying to connect to that Redis using spring-boot-starter-data-redis (spring boot version: 2.3.4.RELEASE, Java version: 11) and using lettuce client but Lettuce is throwing the…
Shubham
  • 2,847
  • 4
  • 24
  • 37
7
votes
4 answers

How to continuosly listen on redis stream using lettuce java library

I am trying to listen on a redis stream and process the message as and when they arrive. I am using async command and I expect the message to be pushed instead of being pulled. So I don't think a while loop is required. But the following code seems…
7
votes
2 answers

Spring data redis concurrency issue

I have a big issue when using multiple threads with spring-redis-data and it's so easy to reproduce that I think I've been missing something trivial. Straight to the point If I query a CrudRepository while doing save operations, it sometimes (up to…
7
votes
1 answer

Lock on redis cluster

I have a Redis cluster of 3 master nodes and each master has corresponding slave nodes. I would like to acquire a lock on the cluster to perform some write operations and then release the lock. From what I've read is - To connect to a cluster we…
7
votes
3 answers

Is it possible to make the application ignore caching in case the cache server fails?

I have a spring boot application with the following properties: spring.cache.type: redis spring.redis.host: spring.redis.port: Right now if the remote host fails the application also fails with a connection error. As in this…
Phate
  • 6,066
  • 15
  • 73
  • 138
7
votes
1 answer

Spring Cache Exception: io.lettuce.core.RedisCommandExecutionException: ERR wrong number of arguments for 'set' command

I use Spring Boot Version: 2.1.4.RELEASE When I set spring.cache.redis.time-to-live=20000 in application.yml file.I got a exception. What should I do when I want to add TTL in redis cache ? How to use cache expiration at Spring Cache with…
itning
  • 150
  • 1
  • 8
7
votes
1 answer

How to monitor Spring-data-redis pool metrics?

I want to monitor the pool metrics in Spring-data-redis. JedisConnectionFactory's pool is private. How can I get it? I search google but I cannot find good way to do this.
XiaJun
  • 1,855
  • 4
  • 24
  • 41
7
votes
3 answers

Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration

After adding 2 dependencies shown below to my application everything works fine my session data is written to my local redis server, but when i try to specify different address of redis server i got an error. I assume that error is connected with…
bkubiak
  • 315
  • 2
  • 3
  • 12
7
votes
1 answer

Getting error redis.clients.jedis.exceptions.JedisMovedDataException: MOVED

I have clustered redis and trying to insert data in there using redisTemplate. I am getting error below when it reached to line that is trying to put data. "redis.clients.jedis.exceptions.JedisMovedDataException:…
user5796415
  • 71
  • 1
  • 3
1 2
3
68 69