Skip to content
Branch: master
Find file History
Latest commit 4cd8bf8 Apr 11, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
redisson-spring-data-16 [maven-release-plugin] prepare for next development iteration Apr 5, 2019
redisson-spring-data-17
redisson-spring-data-18 [maven-release-plugin] prepare for next development iteration Apr 5, 2019
redisson-spring-data-20
redisson-spring-data-21 [maven-release-plugin] prepare for next development iteration Apr 5, 2019
README.md Update README.md Apr 11, 2019
pom.xml [maven-release-plugin] prepare for next development iteration Apr 5, 2019

README.md

Spring Data Redis integration

Integrates Redisson with Spring Data Redis library. Implements Spring Data's RedisConnectionFactory and ReactiveRedisConnectionFactory interfaces and allows to interact with Redis through RedisTemplate or ReactiveRedisTemplate object.

Supports Spring Data Redis 1.6.x, 1.7.x, 1.8.x, 2.0.x, 2.1.x

Consider Redisson PRO version for advanced features and support by SLA.

Usage

1. Add redisson-spring-data dependency into your project:

Maven

     <dependency>
         <groupId>org.redisson</groupId>
         <!-- for Spring Data Redis v.1.6.x -->
         <artifactId>redisson-spring-data-16</artifactId>
         <!-- for Spring Data Redis v.1.7.x -->
         <artifactId>redisson-spring-data-17</artifactId>
         <!-- for Spring Data Redis v.1.8.x -->
         <artifactId>redisson-spring-data-18</artifactId>
         <!-- for Spring Data Redis v.2.0.x -->
         <artifactId>redisson-spring-data-20</artifactId>
         <!-- for Spring Data Redis v.2.1.x -->
         <artifactId>redisson-spring-data-21</artifactId>
         <version>3.10.6</version>
     </dependency>

Gradle

     // for Spring Data Redis v.1.6.x
     compile 'org.redisson:redisson-spring-data-16:3.10.6'
     // for Spring Data Redis v.1.7.x
     compile 'org.redisson:redisson-spring-data-17:3.10.6'
     // for Spring Data Redis v.1.8.x
     compile 'org.redisson:redisson-spring-data-18:3.10.6'
     // for Spring Data Redis v.2.0.x
     compile 'org.redisson:redisson-spring-data-20:3.10.6'
     // for Spring Data Redis v.2.1.x
     compile 'org.redisson:redisson-spring-data-21:3.10.6'

2. Register RedissonConnectionFactory in Spring context

 @Configuration
 public class RedissonSpringDataConfig {
    
    @Bean
    public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redisson) {
        return new RedissonConnectionFactory(redisson);
    }
    
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redisson(@Value("classpath:/redisson.yaml") Resource configFile) throws IOException {
        Config config = Config.fromYAML(configFile.getInputStream());
        return Redisson.create(config);
    }
    
 }
You can’t perform that action at this time.