Directly use Redisson in Spring Boot

less than 1 minute read

https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter

  • for java 8
    • use redisson-spring-boot-starter 2.15.2
  • /build.gradle
dependencies {
    implementation 'org.redisson:redisson-spring-boot-starter:2.15.2'
}
  • /src/main/resources/application.properties
spring.redis.redisson.config = classpath:redisson.yaml
  • /src/main/resources/redisson.yaml
singleServerConfig:
  password: xxxx
  address: "redis://127.0.0.1:6379"
codec: !<org.redisson.client.codec.StringCodec> {}
  • in java
@Autowired
private RedissonClient redisson;

Updated: