CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-redisson--redisson

Valkey and Redis Java client providing complete Real-Time Data Platform with distributed objects and services

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

index.mddocs/

Redisson

Redisson is a Valkey and Redis Java client that provides a comprehensive Real-Time Data Platform with distributed objects and services. It offers in-memory data grid functionality with distributed collections, locks, synchronization primitives, and messaging capabilities, all with support for reactive programming models.

Package Information

  • Package Name: org.redisson:redisson
  • Package Type: maven
  • Language: Java
  • Installation: <dependency><groupId>org.redisson</groupId><artifactId>redisson</artifactId><version>3.50.0</version></dependency>

Core Imports

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.api.RedissonReactiveClient;
import org.redisson.api.RedissonRxClient;
import org.redisson.config.Config;

Basic Usage

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.api.RMap;
import org.redisson.api.RLock;
import org.redisson.config.Config;

// Create client with default configuration
RedissonClient redisson = Redisson.create();

// Create client with custom configuration
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
RedissonClient redisson = Redisson.create(config);

// Use distributed map
RMap<String, String> map = redisson.getMap("myMap");
map.put("key1", "value1");
String value = map.get("key1");

// Use distributed lock
RLock lock = redisson.getLock("myLock");
lock.lock();
try {
    // Protected code
} finally {
    lock.unlock();
}

// Cleanup
redisson.shutdown();

Architecture

Redisson is built around several key components:

  • Client Factory: Redisson class provides factory methods for creating different client types
  • Core Interfaces: RedissonClient (sync), RedissonReactiveClient (reactive), RedissonRxClient (RxJava)
  • Configuration System: Config class with various server configuration modes (single, cluster, sentinel, etc.)
  • Distributed Objects: Type-safe distributed collections and data structures
  • Synchronization Primitives: Locks, semaphores, barriers with Redis-backed implementations
  • Codec System: Pluggable serialization with built-in support for JSON, Kryo, FST, and more
  • Reactive Support: Full reactive streams and RxJava integration for non-blocking operations

Capabilities

Client Creation and Configuration

Core client factory methods and configuration options for connecting to Redis servers in various deployment modes.

// Factory methods
public static RedissonClient create();
public static RedissonClient create(Config config);

// Reactive client access
public RedissonReactiveClient reactive();
public RedissonRxClient rxJava();

Configuration and Client Setup

Distributed Collections

Distributed implementations of standard Java collections including maps, lists, sets, queues, and specialized collections with Redis persistence.

// Maps and caches
public <K, V> RMap<K, V> getMap(String name);
public <K, V> RMapCache<K, V> getMapCache(String name);
public <K, V> RLocalCachedMap<K, V> getLocalCachedMap(LocalCachedMapOptions<K, V> options);

// Lists and sequences
public <V> RList<V> getList(String name);

// Sets and sorted sets
public <V> RSet<V> getSet(String name);
public <V> RSortedSet<V> getSortedSet(String name);
public <V> RScoredSortedSet<V> getScoredSortedSet(String name);
public RLexSortedSet getLexSortedSet(String name);

// Queues and deques
public <V> RQueue<V> getQueue(String name);
public <V> RBlockingQueue<V> getBlockingQueue(String name);
public <V> RDeque<V> getDeque(String name);
public <V> RPriorityQueue<V> getPriorityQueue(String name);

// Multimaps
public <K, V> RListMultimap<K, V> getListMultimap(String name);
public <K, V> RSetMultimap<K, V> getSetMultimap(String name);

Distributed Collections

Locks and Synchronization

Distributed locking and synchronization primitives for coordinating access across multiple JVM instances.

// Locks
public RLock getLock(String name);
public RLock getFairLock(String name);
public RLock getSpinLock(String name);
public RFencedLock getFencedLock(String name);
public RReadWriteLock getReadWriteLock(String name);

// Multi-locks
public RLock getMultiLock(RLock... locks);

// Synchronization primitives
public RSemaphore getSemaphore(String name);
public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name);
public RCountDownLatch getCountDownLatch(String name);

Locks and Synchronization

Reactive and Async APIs

Non-blocking reactive programming support with Reactive Streams and RxJava interfaces for all distributed objects.

// Reactive client interface
public interface RedissonReactiveClient {
    <K, V> RMapReactive<K, V> getMap(String name);
    RLockReactive getLock(String name);
}

// RxJava client interface  
public interface RedissonRxClient {
    <K, V> RMapRx<K, V> getMap(String name);
    RLockRx getLock(String name);
}

Reactive and Async APIs

Pub/Sub Messaging

Publish/subscribe messaging system with pattern matching, sharding, and reliable delivery options.

// Topics
public RTopic getTopic(String name);
public RPatternTopic getPatternTopic(String pattern);
public RShardedTopic getShardedTopic(String name);
public RReliableTopic getReliableTopic(String name);

Pub/Sub Messaging

Specialized Data Structures

Advanced data structures including atomic values, probabilistic structures, geospatial operations, time series, streams, and utility objects.

// Atomic values
public RAtomicLong getAtomicLong(String name);
public RAtomicDouble getAtomicDouble(String name);
public RLongAdder getLongAdder(String name);
public RDoubleAdder getDoubleAdder(String name);

// Probabilistic structures
public <V> RBloomFilter<V> getBloomFilter(String name);
public <V> RHyperLogLog<V> getHyperLogLog(String name);

// Geospatial and binary operations
public <V> RGeo<V> getGeo(String name);
public RBitSet getBitSet(String name);

// Time series and streams (Redis 5.0.0+)
public <V, L> RTimeSeries<V, L> getTimeSeries(String name);
public <K, V> RStream<K, V> getStream(String name);

// Utility structures
public RIdGenerator getIdGenerator(String name);
public RRateLimiter getRateLimiter(String name);

// Data holders
public <V> RBucket<V> getBucket(String name);
public <V> RJsonBucket<V> getJsonBucket(JsonBucketOptions<V> options);

Specialized Data Structures

Advanced Services

Enterprise-grade services for search, scripting, remote procedure calls, and distributed computing.

// Search capabilities (RediSearch module)
public RSearch getSearch();

// Script and function execution
public RScript getScript();
public RFunction getFunction();

// Remote services and executors
public RRemoteService getRemoteService(String name);
public RScheduledExecutorService getExecutorService(String name);

// Live object service
public RLiveObjectService getLiveObjectService();

// Transactions and batching
public RTransaction createTransaction(TransactionOptions options);
public RBatch createBatch(BatchOptions options);

Core Types

// Main client interface
public interface RedissonClient {
    Config getConfig();
    void shutdown();
    void shutdown(long quietPeriod, long timeout, TimeUnit unit);
    boolean isShutdown();
    boolean isShuttingDown();
    String getId();
}

// Base object interface
public interface RObject {
    String getName();
    Codec getCodec();
}

// Expirable object interface
public interface RExpirable extends RExpirableAsync {
    boolean expire(long timeToLive, TimeUnit timeUnit);
    boolean expireAt(long timestamp);
    boolean expireAt(Date timestamp);
    boolean clearExpire();
    long remainTimeToLive();
    long getExpireTime();
}

// Async operations interface
public interface RObjectAsync {
    RFuture<Boolean> touchAsync();
    RFuture<Boolean> unlinkAsync();
    RFuture<Boolean> deleteAsync();
    RFuture<Boolean> isExistsAsync();
}

docs

collections.md

configuration.md

data-structures.md

index.md

messaging.md

reactive-async.md

synchronization.md

tile.json