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
7
votes
1 answer

Is it possible to use RedisRepositories and KeyValueRepositories?

I'm trying to use @EnableRedisRepositories and @EnableMapRepositories in a project and I'm getting the following error message: Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name…
vrish88
  • 20,047
  • 8
  • 38
  • 56
7
votes
1 answer

Spring Data Redis bulk save using repository too slow, how to pipeline repository saves

we are saving 250k Objects in Redis using Spring Data Redis Repositories (repository.save(List)). its too slow. its taking around 30 minutes. i am using redisTemplate with pipeline to save 250k objects with same redis data structure as repository…
7
votes
1 answer

Spring data redis override default serializer

I am trying to create a RedisTemplate bean which will have the updated value serializer to serialize an object in JSON format in redis. @Configuration class RedisConfig { @Bean(name = ["redisTemplate"]) @Primary fun template(factory:…
Prateek Jain
  • 1,504
  • 4
  • 17
  • 27
7
votes
1 answer

Docker Swarm Redis and Sentinel with master - slave replication IP resolution client failure

I am running into an issue and I am not sure how to resolve this. My redis sentinel eco system is as follows: 3 sentinel cluster --> Managing 1 master and 2 slaves using docker-compose I have created a docker overlay network for the eco system and…
sharman
  • 515
  • 1
  • 5
  • 18
7
votes
2 answers

Is there a spring data redis mapping the Redisson framework

As the title says, was there a spring data redis mapping to the Redisson framework (http://redisson.org)
EvilJinious1
  • 2,773
  • 6
  • 43
  • 63
7
votes
1 answer

How to create a second RedisTemplate instance in a Spring Boot application

According to this answer, one RedisTemplate cannot support multiple serializers for values. So I want to create multiple RedisTemplates for different needs, specifically one for string actions and one for object to JSON serializations, to be used in…
Derek
  • 1,085
  • 2
  • 20
  • 36
7
votes
2 answers

How to use Spring Session + Spring security xml configuration and multiply security filter

Background Hey all, We have Spring project which uses Spring security. We have defined the security filters by defining whith filter-chain-map and in…
oak
  • 2,898
  • 2
  • 32
  • 65
7
votes
1 answer

How to serialize multiple types in Spring Redis Cache?

The RedisCacheManager only takes a single RedisTemplate, which means it can only serialize a single type of object. Since I have multiple types of object to be serialized, how do i go about it?
pdeva
  • 43,605
  • 46
  • 133
  • 171
7
votes
2 answers

How to implement transaction in Spring Data Redis in a clean way?

I am following RetwisJ tutorial available here. In this I don't think Redis transactions are implemented. For example, in the following function, if some exception occurs in between, the data will be left in an inconsistent state. I want to know how…
sinujohn
  • 2,506
  • 3
  • 21
  • 26
6
votes
1 answer

How to prevent fail fast on external connection failure like Redis server in Spring boot?

Is there a way to prevent spring-boot application from failing on startup due to external connection failures? I have found other similar questions that suggest using @Lazy annotation to prevent @Configuration beans initialisation but this solution…
Akash
  • 4,412
  • 4
  • 30
  • 48
6
votes
1 answer

How connection pooling works with RedisTemplate using spring boot application

I have the following code snippet which for getting the RedisTemplate. @Bean public JedisConnectionFactory getJedisConnectionFactory() { RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); …
Parveen
  • 149
  • 1
  • 12
6
votes
2 answers

How to use consumer groups with Spring Data Redis for Redis Streams (keep getting NOGROUP)?

I'm trying to use Spring Data Redis to consume a Redis Stream using consumer groups, but keep getting the following exception: Caused by: io.lettuce.core.RedisCommandExecutionException: NOGROUP No such key 'event-stream' or consumer group 'my-group'…
WickedElephant
  • 327
  • 2
  • 9
6
votes
2 answers

How to disable Redis cache with Spring Boot?

With Spring Boot 2.1 I am defining a RedisCacheManager bean in a configuration file, with Java configuration. Everything works correctly but I would like sometimes to disable it, for instance in the tests. Spring Boot provides the…
6
votes
1 answer

Spring boot 2.1.3.RELEASE An illegal reflective access operation has occurred

I get the following in red lines in my log files with JAVA 11. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.util.ReflectionUtils…
Saurabh Kumar
  • 16,353
  • 49
  • 133
  • 212
6
votes
1 answer

@EnableRedisRepositories - What is the use of in Spring Data Redis?

I search a lot over web to get more practical usage of @EnableRedisRepositories, but I did not found any. Even in my Spring Boot + Spring Data Redis example, I removed @EnableRedisRepositories but still I did not understood what difference it make,…
Jeff Cook
  • 7,956
  • 36
  • 115
  • 186