Getting Started
-
Add dependency
-
Start development
-
Create config object.
Use one of supported modes: (single mode, replicated mode, cluster mode, sentinel mode, proxy mode, multi cluster mode, multi sentinel mode)Config config = new Config(); config.useClusterServers() // use "redis://" for Redis connection // use "valkey://" for Valkey connection // use "valkeys://" for Valkey SSL connection // use "rediss://" for Redis SSL connection .addNodeAddress("redis://127.0.0.1:7181"); // or read config from file config = Config.fromYAML(new File("config-file.yaml"));
-
Create Redisson instance.
-
Get Redis or Valkey based object or service.
// java.util.concurrent.ConcurrentMap RMap<MyKey, MyValue> map = redisson.getMap("myMap"); RMapReactive<MyKey, MyValue> mapReactive = redissonReactive.getMap("myMap"); RMapRx<MyKey, MyValue> mapRx = redissonRx.getMap("myMap"); // client side caching RLocalCachedMap<MyKey, MyValue> map = redisson.getLocalCachedMap(LocalCachedMapOptions.<MyKey, MyValue>name("myMap")); // java.util.concurrent.locks.Lock RLock lock = redisson.getLock("myLock"); RLockReactive lockReactive = redissonReactive.getLock("myLock"); RLockRx lockRx = redissonRx.getLock("myLock"); // java.util.concurrent.ExecutorService RExecutorService executor = redisson.getExecutorService("myExecutorService"); // over 50 Redis or Valkey based Java objects and services ...
-
More code examples can be found here.
Spring Boot Starter
- Spring Boot Starter: Learn how to configure a Spring Boot Starter with Redisson.
Spring Data Redis
- Spring Data Redis: Learn how to configure a Spring Data Redis integration with Redisson.
Spring Cloud Stream
- Spring Cloud Stream: Learn how to configure a Spring Cloud Stream Binder for using Valkey or Redis as a message broker.
Quarkus Integration
- Quarkus Integration: Learn how to configure a Quarkus and Quarkus cache.
Micronaut Integration
- Micronaut Integration: Learn how to configure a Micronaut, Micronaut Session and Micronaut cache.
Helidon Integration
- Helidon Integration: Learn how to configure a Helidon.
JCache API (JSR-107)
- JCache API (JSR-107): Learn how to configure a Redisson as a JCache provider.
MyBatis Cache
- MyBatis Cache: Learn how to configure a Redisson as a second-level cache in MyBatis.
Hibernate Cache
- Hibernate Cache: Learn how to configure a Redisson as a second-level cache in Hibernate.
Tomcat Integration
- Tomcat Session Management: Learn how to configure Redisson as a session manager for Apache Tomcat, using Valkey or Redis based distributed session storage.