spring-data-redis

Spring Boot redisTemplate autowiring failed

六眼飞鱼酱① 提交于 2019-12-11 08:51:44
问题 I tried to integrate spring boot + redis into my application. Related settings in pom.xml is as below, <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> Application main is as below, @SpringBootApplication @EnableTransactionManagement @ImportResource({"classpath*:applicationContext.xml"}) public class ExamsCenterApplication { public static void main(String[] args) { SpringApplication.run(ExamsCenterApplication.class,

Does Spring Data Redis (1.3.2.RELEASE) support JedisSentinelPool of jedis?

妖精的绣舞 提交于 2019-12-11 05:28:52
问题 Does Spring Data Redis (1.3.2.RELEASE) support JedisSentinelPool of jedis? Maybe it doesn't support,who will give me an answer? If it doesn't support,how should I do? 回答1: Support for Redis Sentinel is added to Spring Data Redis 1.4. It will be in the upcoming Evans RC1, allowing configuration of JedisConnectionFactory to make use of JedisSentinelPool . RedisSentinelConfiguration sentinelConfig = new RedisSentinelConfiguration() .master("mymaster") .sentinel("127.0.0.1", 26379) .sentinel("127

How to avoid creation of Multiple Method Interceptors for the method with cache annotations when using spring data jpa and spring data redis

跟風遠走 提交于 2019-12-11 04:10:43
问题 In my application I am using two data modules (spring-boot-starter-data-jpa and spring-boot-starter-data-redis). I have a method annotated with @CachPut to store in cache. this method is called once but the actual CachePut operation is happening twice. when I debug there are two proxies created which intercepts the same method. When I use only one module spring-boot-starter-data-redis it works as expected because there is only one proxy created which intercepts the method having @CachPut

Not able Scan using redis template

不想你离开。 提交于 2019-12-11 02:49:12
问题 I am trying to use SCAN http://redis.io/commands/scan to iterate over all the keys present in redis. But the Redis template provided by spring do not have any scan() method. Is there any trick to use the above? Thanks 回答1: You can use a RedisCallback on RedisOperations to do so. redisTemplate.execute(new RedisCallback<Iterable<byte[]>>() { @Override public Iterable<byte[]> doInRedis(RedisConnection connection) throws DataAccessException { List<byte[]> binaryKeys = new ArrayList<byte[]>();

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

独自空忆成欢 提交于 2019-12-10 13:25:41
问题 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 some dependencies problem, but i dont know how to tackle this issue. compile "org.springframework.boot:spring-boot-starter-data-redis-reactive:${springVersion}" compile "org.springframework.session:spring-session-data-redis:${springVersion}" Error

Spring Data Redis with multi tenancy

a 夏天 提交于 2019-12-08 13:36:50
问题 I am using Spring Data Redis, with spring data abstraction not using directly RedisTemplate. My data model like below: @RedisHash(value = “products") public class Product { @Id @Indexed private String id; private String description; private BigDecimal price; private String imageUrl; //Getter and Setter } My repositories with spring data abstraction: @Repository public interface ProductRepository extends CrudRepository<Product,String> { } This is my config : @Configuration

How to connect to multiple redis instances with spring-data-redis

与世无争的帅哥 提交于 2019-12-08 07:30:57
问题 I'm trying to connect with one springboot application to 2 different redis instances: one used as database and one used as cache only. I added different connection factories and redis templates with different names and I'm using @Qualifier to link them. I tried to disable from auto configuration the class RedisAutoConfiguration, but nothing works. I always receive this error: Wrapped by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name

Create Lettuce StatefulRedisConnection for storing string as keys and byte array as value

喜欢而已 提交于 2019-12-08 05:26:25
I have a Spring boot application which connects to a Redis cluster on AWS. I was trying out Lettuce, and want to create a StatefulRedisConnection for storing keys as string, but values as byte array. I tried using the built-in ByteArrayCodec , but it takes both the key and value as a byte array. I'm new to Lettuce, so I'm not sure whether I need to write a custom codec. If so, how would I write it? And would there be any performance issues? Or am I going down the wrong path? Below code will allow you to have string key and byte array as value. public class StringByteCodec implements RedisCodec

Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration

ぃ、小莉子 提交于 2019-12-08 04:07:32
问题 I am getting the below error when developing the Spring Boot + Spring Data Redis example. In this example, I'm looking to implement contains method which is not possible as per spring doc and link here : Caused by: java.lang.IllegalArgumentException: CONTAINING (1): [IsContaining, Containing, Contains]is not supported for redis query derivation - Redis which will pull data as per matching details. *************************** APPLICATION FAILED TO START *************************** Description:

Redis Hash Pagination

别等时光非礼了梦想. 提交于 2019-12-07 18:17:17
问题 I am using the Redis Hash , in which I am storing student id as the key (which is not numeric), the value is POJO of student data. now I need redis-pagination i.e. I don't care about the students' order but I want to fetch only some students data in one go. can I do this in Redis? if for supporting the pagination some modification in the data structure is required that would be ok too. P.S. I am using spring-data-redis . but the solution without it would be ok too. basically, I want to find