g1335333249 / redisson

Redisson - Redis Java client with features of In-Memory Data Grid. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Publish / Subscribe, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, MyBatis, RPC, local cache ...

Home Page:https://redisson.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redisson - Redis Java客户端
具有内存数据网格的功能

Maven Central JavaDoc License

快速开始 | 文档 | 变更日志 | 代码示例 | 常见问题 | 报告问题

基于高性能异步无锁Java Redis客户端和 Netty 框架。
JDK 兼容性:1.8 - 16,Android

特点

成功案例

快速开始

Maven

<dependency>
   <groupId>org.redisson</groupId>
   <artifactId>redisson</artifactId>
   <version>3.16.1</version>
</dependency>  

Gradle

compile 'org.redisson:redisson:3.16.1'  

SBT

libraryDependencies += "org.redisson" % "redisson" % "3.16.1"

Java

// 1. 创建配置对象
Config config = new Config();
config.useClusterServers()
       // 使用“rediss:”进行 SSL 连接
      .addNodeAddress("redis://127.0.0.1:7181");

// 或从文件中读取配置
config = Config.fromYAML(new File("config-file.yaml")); 
// 2. 创建Redisson实例

// Sync and Async API
RedissonClient redisson = Redisson.create(config);

// Reactive API
RedissonReactiveClient redissonReactive = redisson.reactive();

// RxJava3 API
RedissonRxClient redissonRx = redisson.rxJava();
// 3. 获取基于 Redis 的 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");
// 4. 获取基于 Redis 的 java.util.concurrent.locks.Lock 实现
RLock lock = redisson.getLock("myLock");

RLockReactive lockReactive = redissonReactive.getLock("myLock");

RLockRx lockRx = redissonRx.getLock("myLock");
// 4. 获取基于 Redis 的 java.util.concurrent.ExecutorService 实现
RExecutorService executor = redisson.getExecutorService("myExecutorService");

// over 50 Redis based Java objects and services ...

考虑 Redisson PRO 版本以获得超快的性能和 SLA 支持。

下载

Redisson 3.16.1, Redisson node 3.16.1

常见问题

Q: What is the cause of RedisTimeoutException?

Q: When do I need to shut down a Redisson instance, at the end of each request or the end of the life of a thread?

Q: In MapCache/SetCache/SpringCache/JCache, I have set an expiry time to an entry, why is it still in Redis when it should be disappeared?

Q: How can I perform Pipelining/Transaction through Redisson?

Q: Is Redisson thread safe? Can I share an instance of it between different threads?

Q: Can I use different encoder/decoders for different tasks?

About

Redisson - Redis Java client with features of In-Memory Data Grid. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Publish / Subscribe, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, MyBatis, RPC, local cache ...

https://redisson.pro

License:Apache License 2.0


Languages

Language:Java 100.0%