spring-data-redis

Unable to get result from the Redis using Crud Repository in Spring Boot?

风流意气都作罢 提交于 2020-07-05 16:23:08
问题 I am developing Spring Boot + Redis example. I've taken a reference from link : https://www.baeldung.com/spring-data-redis-tutorial. In this example, I developed repository method Student findByNameAndGender(String name, Gender gender); and even the Student findByName(String name); , but I am not getting any result back on both cases.? Any quick help? Redis query - redis 127.0.0.1:6379> KEYS * 1) "Student" 2) "Student:bb4df14a-7f42-4fc3-b608-fc4b7d45109e" 3) "Student:69affaa4-e56c-49e3-9ef4

RedisCustomConversions using Redis Repository

我的未来我决定 提交于 2020-06-01 05:08:49
问题 Is it possible to use custom Redis converters with Spring-Data Repository? I see the example in https://docs.spring.io/spring-data/data-redis/docs/current/reference/html/#redis.hashmappers.jackson2 but I get the following error when I try it. @Bean definition illegally overridden by existing bean definition: Root bean: class [org.springframework.data.redis.core.convert.RedisCustomConversions] My code to register the converter is @Bean fun redisCustomConversions():RedisCustomConversions {

Atomic increment with Spring Data for AWS ElastiCache (Redis)

不问归期 提交于 2020-03-25 19:16:07
问题 We have multiple instances of the same application deployed behind an ELB (Load Balancer). Whenever a certain job is done, we count some elements and then want to increment a counter's value. We use ElastiCache to hold these metrics in memory. We have set it up as a Cluster of Redis instances. I'm having trouble understanding how to properly interact with ElastiCache so that the counter never misses any increment (i.e. an atomic operation). I know INCRBY seems to be the way to go, but I'm not

Range Querying in Redis - Spring Data Redis

无人久伴 提交于 2020-02-02 13:12:27
问题 is there a way we can implement Range queries in Redis using Spring Data Redis? Eg: If my Pojo class has Date(which is not a unique identifier in my DataModel) and i require data that falls under a desired period of date, Is it possible with Spring Data Redis to construct a query for the same rather than querying each date individually? 来源: https://stackoverflow.com/questions/59888313/range-querying-in-redis-spring-data-redis

NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute

旧时模样 提交于 2020-01-12 07:12:09
问题 I am trying to use spring-data-redis in a spring-boot application to work with redis. I am creating JedisConnectionFactory as follows: RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(); configuration.setHostName("localhost"); configuration.setPort(6379); JedisConnectionFactory connectionFactory = new JedisConnectionFactory(configuration); It throws the exception: Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.data.repository.config

How to use spring data redis pipeline to process 1 million records?

末鹿安然 提交于 2020-01-11 07:07:49
问题 I have a requirement where I have to read a file which contains around 1 million records each record in a separate line. Each record will be validated and then will be saved in Redis cache. I implemented this in a normal traditional way by reading each line and saving it in the Redis cache but it is hampering performance very badly. Then I came to know about Redis pipeline feature in which I will process records in a batch say 10k at a time in order to improve performance . How can I use this

spring-data-redis 用法

我与影子孤独终老i 提交于 2020-01-07 04:25:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、jar包支持 <!-- redis支持 --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> <version>1.1.0.RELEASE</version> </dependency> <!-- redis支持 --> 二、spring配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema

LazyInitializationException when trying to access detached objects left around in Redis by RedisCacheManager

江枫思渺然 提交于 2020-01-06 13:59:39
问题 I use Spring data Redis in order to cache serialized JPA entities in Redis using org.springframework.data.redis.cache.RedisCacheManager Here is the method: @Override @Cacheable(value = MapCacheConfiguration.DATABASE_CACHE_NAME, key = "#root.method.name") public Curriculum findCurriculumByMemberId(Long memberId) { return curriculumRepository.findCurriculumByMemberId(memberId); } Unfortunately, upon restart of my boot application, the entities are still cached in Redis and I get a org.hibernate

LazyInitializationException when trying to access detached objects left around in Redis by RedisCacheManager

懵懂的女人 提交于 2020-01-06 13:59:12
问题 I use Spring data Redis in order to cache serialized JPA entities in Redis using org.springframework.data.redis.cache.RedisCacheManager Here is the method: @Override @Cacheable(value = MapCacheConfiguration.DATABASE_CACHE_NAME, key = "#root.method.name") public Curriculum findCurriculumByMemberId(Long memberId) { return curriculumRepository.findCurriculumByMemberId(memberId); } Unfortunately, upon restart of my boot application, the entities are still cached in Redis and I get a org.hibernate

Query Nested Objects in Redis using Spring Data

拈花ヽ惹草 提交于 2020-01-04 05:43:08
问题 I have a java object as below that i store in a redis store. @RedisHash("UserProfile") public class UserProfile implements Serializable { @Id String id; @Reference PersonalInfo personalInfo = new PersonalInfo(); @Reference BusinessInfo businessInfo = new BusinessInfo(); ... } Now, the PersonalInfo object is structured as: public class PersonalInfo { private String firstName; private String lastName; @Indexed private String userId; private ContactInfo contactInfo = new ContactInfo(); } Note