All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.redisson.RedissonRx Maven / Gradle / Ivy

Go to download

Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC

The newest version!
/**
 * Copyright (c) 2013-2024 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson;

import org.redisson.api.LocalCachedMapOptions;
import org.redisson.api.MapCacheOptions;
import org.redisson.api.MapOptions;
import org.redisson.api.*;
import org.redisson.api.options.*;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import org.redisson.config.Config;
import org.redisson.config.ConfigSupport;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
import org.redisson.liveobject.core.RedissonObjectBuilder;
import org.redisson.rx.*;

import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;

/**
 * Main infrastructure class allows to get access
 * to all Redisson objects on top of Redis server.
 *
 * @author Nikita Koksharov
 *
 */
public class RedissonRx implements RedissonRxClient {

    protected final WriteBehindService writeBehindService;
    protected final EvictionScheduler evictionScheduler;
    protected final CommandRxExecutor commandExecutor;
    protected final ConnectionManager connectionManager;

    @Deprecated
    protected RedissonRx(Config config) {
        Config configCopy = new Config(config);

        connectionManager = ConfigSupport.createConnectionManager(configCopy);
        RedissonObjectBuilder objectBuilder = null;
        if (connectionManager.getServiceManager().getCfg().isReferenceEnabled()) {
            objectBuilder = new RedissonObjectBuilder(this);
        }
        commandExecutor = new CommandRxService(connectionManager, objectBuilder);
        evictionScheduler = new EvictionScheduler(commandExecutor);
        writeBehindService = new WriteBehindService(commandExecutor);
    }

    protected RedissonRx(ConnectionManager connectionManager, EvictionScheduler evictionScheduler, WriteBehindService writeBehindService) {
        this.connectionManager = connectionManager;
        RedissonObjectBuilder objectBuilder = null;
        if (connectionManager.getServiceManager().getCfg().isReferenceEnabled()) {
            objectBuilder = new RedissonObjectBuilder(this);
        }
        commandExecutor = new CommandRxService(connectionManager, objectBuilder);
        this.evictionScheduler = evictionScheduler;
        this.writeBehindService = writeBehindService;
    }

    public CommandRxExecutor getCommandExecutor() {
        return commandExecutor;
    }

    @Override
    public  RStreamRx getStream(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonStream(commandExecutor, name), RStreamRx.class);
    }

    @Override
    public  RStreamRx getStream(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonStream(codec, commandExecutor, name), RStreamRx.class);
    }

    @Override
    public  RStreamRx getStream(PlainOptions options) {
        PlainParams params = (PlainParams) options;

        return RxProxyBuilder.create(commandExecutor,
                new RedissonStream(params.getCodec(), commandExecutor.copy(params), params.getName()), RStreamRx.class);
    }

    @Override
    public RSearchRx getSearch() {
        return getSearch((Codec) null);
    }

    @Override
    public RSearchRx getSearch(Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonSearch(codec, commandExecutor), RSearchRx.class);
    }

    @Override
    public RSearchRx getSearch(OptionalOptions options) {
        OptionalParams params = (OptionalParams) options;
        return RxProxyBuilder.create(commandExecutor,
                new RedissonSearch(params.getCodec(), commandExecutor.copy(params)), RSearchRx.class);
    }

    @Override
    public  RGeoRx getGeo(String name) {
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, new RedissonGeo(commandExecutor, name, null), 
                new RedissonScoredSortedSetRx(set), RGeoRx.class);
    }
    
    @Override
    public  RGeoRx getGeo(String name, Codec codec) {
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, new RedissonGeo(codec, commandExecutor, name, null), 
                new RedissonScoredSortedSetRx(set), RGeoRx.class);
    }

    @Override
    public  RGeoRx getGeo(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, new RedissonGeo(params.getCodec(), ce, params.getName(), null),
                new RedissonScoredSortedSetRx(set), RGeoRx.class);
    }

    @Override
    public RLockRx getFairLock(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonFairLock(commandExecutor, name), RLockRx.class);
    }

    @Override
    public RLockRx getFairLock(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        return RxProxyBuilder.create(commandExecutor,
                            new RedissonFairLock(commandExecutor.copy(params), params.getName()), RLockRx.class);
    }

    @Override
    public RRateLimiterRx getRateLimiter(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonRateLimiter(commandExecutor, name), RRateLimiterRx.class);
    }

    @Override
    public RRateLimiterRx getRateLimiter(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        return RxProxyBuilder.create(commandExecutor,
                new RedissonRateLimiter(commandExecutor.copy(params), params.getName()), RRateLimiterRx.class);
    }

    @Override
    public RBinaryStreamRx getBinaryStream(String name) {
        RedissonBinaryStream stream = new RedissonBinaryStream(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, stream,
                new RedissonBinaryStreamRx(commandExecutor, stream), RBinaryStreamRx.class);
    }

    @Override
    public RBinaryStreamRx getBinaryStream(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonBinaryStream stream = new RedissonBinaryStream(ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, stream,
                new RedissonBinaryStreamRx(ce, stream), RBinaryStreamRx.class);
    }

    @Override
    public RSemaphoreRx getSemaphore(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonSemaphore(commandExecutor, name), RSemaphoreRx.class);
    }

    @Override
    public RSemaphoreRx getSemaphore(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonSemaphore(ce, params.getName()), RSemaphoreRx.class);
    }

    @Override
    public RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonPermitExpirableSemaphore(commandExecutor, name), RPermitExpirableSemaphoreRx.class);
    }

    @Override
    public RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor,
                new RedissonPermitExpirableSemaphore(ce, params.getName()), RPermitExpirableSemaphoreRx.class);
    }

    @Override
    public RReadWriteLockRx getReadWriteLock(String name) {
        return new RedissonReadWriteLockRx(commandExecutor, name);
    }

    @Override
    public RReadWriteLockRx getReadWriteLock(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return new RedissonReadWriteLockRx(ce, params.getName());
    }

    @Override
    public RLockRx getLock(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockRx.class);
    }

    @Override
    public RLockRx getLock(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonLock(ce, params.getName()), RLockRx.class);
    }

    @Override
    public RLockRx getSpinLock(String name) {
        return getSpinLock(name, LockOptions.defaults());
    }

    @Override
    public RLockRx getSpinLock(String name, LockOptions.BackOff backOff) {
        RedissonSpinLock spinLock = new RedissonSpinLock(commandExecutor, name, backOff);
        return RxProxyBuilder.create(commandExecutor, spinLock, RLockRx.class);
    }

    @Override
    public RFencedLockRx getFencedLock(String name) {
        RedissonFencedLock lock = new RedissonFencedLock(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, lock, RFencedLockRx.class);
    }

    @Override
    public RFencedLockRx getFencedLock(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonFencedLock lock = new RedissonFencedLock(ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, lock, RFencedLockRx.class);
    }

    @Override
    public RLockRx getMultiLock(RLockRx... locks) {
        RLock[] ls = Arrays.stream(locks)
                            .map(l -> new RedissonLock(commandExecutor, l.getName()))
                            .toArray(RLock[]::new);
        return RxProxyBuilder.create(commandExecutor, new RedissonMultiLock(ls), RLockRx.class);
    }

    @Override
    public RLockRx getMultiLock(String group, Collection values) {
        return RxProxyBuilder.create(commandExecutor, new RedissonFasterMultiLock(commandExecutor, group, values), RLockRx.class);
    }

    @Override
    public RLockRx getMultiLock(RLock... locks) {
        return RxProxyBuilder.create(commandExecutor, new RedissonMultiLock(locks), RLockRx.class);
    }
    
    @Override
    public RLockRx getRedLock(RLock... locks) {
        return RxProxyBuilder.create(commandExecutor, new RedissonRedLock(locks), RLockRx.class);
    }

    @Override
    public RCountDownLatchRx getCountDownLatch(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(commandExecutor, name), RCountDownLatchRx.class);
    }

    @Override
    public RCountDownLatchRx getCountDownLatch(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(ce, params.getName()), RCountDownLatchRx.class);
    }

    @Override
    public  RMapCacheRx getMapCache(String name, Codec codec) {
        RMap map = new RedissonMapCache(codec, evictionScheduler, commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
    }

    @Override
    public  RMapCacheRx getMapCache(String name) {
        RedissonMapCache map = new RedissonMapCache(evictionScheduler, commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
    }

    @Override
    public  RMapCacheRx getMapCache(org.redisson.api.options.MapCacheOptions options) {
        MapCacheParams params = (MapCacheParams) options;
        MapCacheOptions ops = MapCacheOptions.defaults()
                .loader(params.getLoader())
                .loaderAsync(params.getLoaderAsync())
                .writer(params.getWriter())
                .writerAsync(params.getWriterAsync())
                .writeBehindDelay(params.getWriteBehindDelay())
                .writeBehindBatchSize(params.getWriteBehindBatchSize())
                .writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));

        if (params.isRemoveEmptyEvictionTask()) {
            ops.removeEmptyEvictionTask();
        }

        if (params.getWriteMode() != null) {
            ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
        }
        if (params.getWriteRetryAttempts() > 0) {
            ops.writerRetryAttempts(params.getWriteRetryAttempts());
        }

        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonMapCache map = new RedissonMapCache<>(params.getCodec(), evictionScheduler,
                ce, params.getName(), null, ops, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapCacheRx(map, ce), RMapCacheRx.class);
    }

    @Override
    public  RBucketRx getBucket(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBucket(commandExecutor, name), RBucketRx.class);
    }

    @Override
    public  RBucketRx getBucket(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBucket(codec, commandExecutor, name), RBucketRx.class);
    }

    @Override
    public  RBucketRx getBucket(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor,
                new RedissonBucket(params.getCodec(), ce, params.getName()), RBucketRx.class);
    }

    @Override
    public RBucketsRx getBuckets() {
        return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(commandExecutor), RBucketsRx.class);
    }

    @Override
    public RBucketsRx getBuckets(Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(codec, commandExecutor), RBucketsRx.class);
    }

    @Override
    public RBucketsRx getBuckets(OptionalOptions options) {
        OptionalParams params = (OptionalParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(params.getCodec(), ce), RBucketsRx.class);
    }

    @Override
    public  RJsonBucketRx getJsonBucket(String name, JsonCodec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonJsonBucket<>(codec, commandExecutor, name), RJsonBucketRx.class);
    }

    @Override
    public  RJsonBucketRx getJsonBucket(JsonBucketOptions options) {
        JsonBucketParams params = (JsonBucketParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonJsonBucket<>(params.getCodec(), ce, params.getName()), RJsonBucketRx.class);
    }
    
    @Override
    public RJsonBucketsRx getJsonBuckets(JsonCodec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonJsonBuckets(codec, commandExecutor), RJsonBucketsRx.class);
    }
    
    @Override
    public  RHyperLogLogRx getHyperLogLog(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(commandExecutor, name), RHyperLogLogRx.class);
    }

    @Override
    public  RHyperLogLogRx getHyperLogLog(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(codec, commandExecutor, name), RHyperLogLogRx.class);
    }

    @Override
    public  RHyperLogLogRx getHyperLogLog(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(params.getCodec(), ce, params.getName()), RHyperLogLogRx.class);
    }

    @Override
    public RIdGeneratorRx getIdGenerator(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonIdGenerator(commandExecutor, name), RIdGeneratorRx.class);
    }

    @Override
    public RIdGeneratorRx getIdGenerator(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonIdGenerator(ce, params.getName()), RIdGeneratorRx.class);
    }

    @Override
    public  RListRx getList(String name) {
        RedissonList list = new RedissonList(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, list, 
                new RedissonListRx(list), RListRx.class);
    }

    @Override
    public  RListRx getList(String name, Codec codec) {
        RedissonList list = new RedissonList(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, list, 
                new RedissonListRx(list), RListRx.class);
    }

    @Override
    public  RListRx getList(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonList list = new RedissonList(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, list,
                new RedissonListRx(list), RListRx.class);
    }

    @Override
    public  RListMultimapRx getListMultimap(String name) {
        RedissonListMultimap listMultimap = new RedissonListMultimap<>(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
    }

    @Override
    public  RListMultimapRx getListMultimap(String name, Codec codec) {
        RedissonListMultimap listMultimap = new RedissonListMultimap<>(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
    }

    @Override
    public  RListMultimapRx getListMultimap(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonListMultimap listMultimap = new RedissonListMultimap<>(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
    }

    @Override
    public  RListMultimapCacheRx getListMultimapCache(String name) {
        RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheRx.class);
    }

    @Override
    public  RListMultimapCacheRx getListMultimapCache(String name, Codec codec) {
        RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheRx.class);
    }

    @Override
    public  RListMultimapCacheRx getListMultimapCache(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, ce), RListMultimapCacheRx.class);
    }

    @Override
    public  RListMultimapCacheNativeRx getListMultimapCacheNative(String name) {
        RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
    }

    @Override
    public  RListMultimapCacheNativeRx getListMultimapCacheNative(String name, Codec codec) {
        RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
    }

    @Override
    public  RListMultimapCacheNativeRx getListMultimapCacheNative(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, listMultimap,
                new RedissonListMultimapRx(listMultimap, ce), RListMultimapCacheNativeRx.class);
    }

    @Override
    public  RSetMultimapRx getSetMultimap(String name) {
        RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapRx.class);
    }

    @Override
    public  RSetMultimapRx getSetMultimap(String name, Codec codec) {
        RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapRx.class);
    }

    @Override
    public  RSetMultimapRx getSetMultimap(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapRx.class);
    }

    @Override
    public  RSetMultimapCacheRx getSetMultimapCache(String name) {
        RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
    }

    @Override
    public  RSetMultimapCacheRx getSetMultimapCache(String name, Codec codec) {
        RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
    }

    @Override
    public  RSetMultimapCacheRx getSetMultimapCache(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheRx.class);
    }

    @Override
    public  RSetMultimapCacheNativeRx getSetMultimapCacheNative(String name) {
        RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
    }

    @Override
    public  RSetMultimapCacheNativeRx getSetMultimapCacheNative(String name, Codec codec) {
        RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
    }

    @Override
    public  RSetMultimapCacheNativeRx getSetMultimapCacheNative(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, setMultimap,
                new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheNativeRx.class);
    }

    @Override
    public  RMapRx getMap(String name) {
        RedissonMap map = new RedissonMap(commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapRx(map, commandExecutor), RMapRx.class);
    }

    @Override
    public  RMapRx getMap(String name, Codec codec) {
        RedissonMap map = new RedissonMap(codec, commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapRx(map, commandExecutor), RMapRx.class);
    }

    @Override
    public  RMapRx getMap(org.redisson.api.options.MapOptions options) {
        MapParams params = (MapParams) options;
        MapOptions ops = createOptions(params);

        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonMap map = new RedissonMap<>(params.getCodec(), ce, params.getName(), null, ops, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapRx<>(map, ce), RMapRx.class);
    }

    @Override
    public  RSetRx getSet(String name) {
        RedissonSet set = new RedissonSet(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonSetRx(set, this), RSetRx.class);
    }

    @Override
    public  RSetRx getSet(String name, Codec codec) {
        RedissonSet set = new RedissonSet(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonSetRx(set, this), RSetRx.class);
    }

    @Override
    public  RSetRx getSet(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonSet set = new RedissonSet(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, set,
                new RedissonSetRx(set, this), RSetRx.class);
    }

    @Override
    public  RScoredSortedSetRx getScoredSortedSet(String name) {
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonScoredSortedSetRx(set), RScoredSortedSetRx.class);
    }

    @Override
    public  RScoredSortedSetRx getScoredSortedSet(String name, Codec codec) {
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonScoredSortedSetRx(set), RScoredSortedSetRx.class);
    }

    @Override
    public  RScoredSortedSetRx getScoredSortedSet(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonScoredSortedSet set = new RedissonScoredSortedSet(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, set,
                new RedissonScoredSortedSetRx<>(set), RScoredSortedSetRx.class);
    }

    @Override
    public RLexSortedSetRx getLexSortedSet(String name) {
        RedissonLexSortedSet set = new RedissonLexSortedSet(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonLexSortedSetRx(set), RLexSortedSetRx.class);
    }

    @Override
    public RLexSortedSetRx getLexSortedSet(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonLexSortedSet set = new RedissonLexSortedSet(ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, set,
                new RedissonLexSortedSetRx(set), RLexSortedSetRx.class);
    }

    @Override
    public RShardedTopicRx getShardedTopic(String name) {
        RShardedTopic topic = new RedissonShardedTopic(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
    }

    @Override
    public RShardedTopicRx getShardedTopic(String name, Codec codec) {
        RShardedTopic topic = new RedissonShardedTopic(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
    }

    @Override
    public RShardedTopicRx getShardedTopic(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RShardedTopic topic = new RedissonShardedTopic(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
    }

    @Override
    public RTopicRx getTopic(String name) {
        RTopic topic = new RedissonTopic(commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
    }

    @Override
    public RTopicRx getTopic(String name, Codec codec) {
        RTopic topic = new RedissonTopic(codec, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
    }

    @Override
    public RTopicRx getTopic(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RTopic topic = new RedissonTopic(params.getCodec(), ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
    }

    @Override
    public RReliableTopicRx getReliableTopic(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonReliableTopic(commandExecutor, name, null), RReliableTopicRx.class);
    }

    @Override
    public RReliableTopicRx getReliableTopic(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonReliableTopic(codec, commandExecutor, name, null), RReliableTopicRx.class);
    }

    @Override
    public RReliableTopicRx getReliableTopic(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor,
                new RedissonReliableTopic(params.getCodec(), ce, params.getName(), null), RReliableTopicRx.class);
    }

    @Override
    public RPatternTopicRx getPatternTopic(String pattern) {
        return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(commandExecutor, pattern), RPatternTopicRx.class);
    }

    @Override
    public RPatternTopicRx getPatternTopic(String pattern, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(codec, commandExecutor, pattern), RPatternTopicRx.class);
    }

    @Override
    public RPatternTopicRx getPatternTopic(PatternTopicOptions options) {
        PatternTopicParams params = (PatternTopicParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(params.getCodec(), ce, params.getPattern()), RPatternTopicRx.class);
    }

    @Override
    public  RQueueRx getQueue(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonQueue(commandExecutor, name, null), 
                new RedissonListRx(new RedissonList(commandExecutor, name, null)), RQueueRx.class);
    }

    @Override
    public  RQueueRx getQueue(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonQueue(codec, commandExecutor, name, null), 
                new RedissonListRx(new RedissonList(codec, commandExecutor, name, null)), RQueueRx.class);
    }

    @Override
    public  RQueueRx getQueue(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonQueue(params.getCodec(), ce, params.getName(), null),
                new RedissonListRx(new RedissonList(params.getCodec(), ce, params.getName(), null)), RQueueRx.class);
    }

    @Override
    public  RRingBufferRx getRingBuffer(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonRingBuffer(commandExecutor, name, null), RRingBufferRx.class);
    }

    @Override
    public  RRingBufferRx getRingBuffer(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonRingBuffer(codec, commandExecutor, name, null), RRingBufferRx.class);
    }

    @Override
    public  RRingBufferRx getRingBuffer(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor,
                new RedissonRingBuffer(params.getCodec(), ce, params.getName(), null), RRingBufferRx.class);
    }

    @Override
    public  RBlockingQueueRx getBlockingQueue(String name) {
        RedissonBlockingQueue queue = new RedissonBlockingQueue(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, queue, 
                new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
    }

    @Override
    public  RBlockingQueueRx getBlockingQueue(String name, Codec codec) {
        RedissonBlockingQueue queue = new RedissonBlockingQueue(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, queue, 
                new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
    }

    @Override
    public  RBlockingQueueRx getBlockingQueue(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonBlockingQueue queue = new RedissonBlockingQueue(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, queue,
                new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
    }

    @Override
    public  RDequeRx getDeque(String name) {
        RedissonDeque queue = new RedissonDeque(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, queue, 
                new RedissonListRx(queue), RDequeRx.class);
    }

    @Override
    public  RDequeRx getDeque(String name, Codec codec) {
        RedissonDeque queue = new RedissonDeque(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, queue, 
                new RedissonListRx(queue), RDequeRx.class);
    }

    @Override
    public  RDequeRx getDeque(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonDeque queue = new RedissonDeque(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, queue,
                new RedissonListRx(queue), RDequeRx.class);
    }

    @Override
    public  RTimeSeriesRx getTimeSeries(String name) {
        RTimeSeries timeSeries = new RedissonTimeSeries(evictionScheduler, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, timeSeries,
                new RedissonTimeSeriesRx(timeSeries, this), RTimeSeriesRx.class);
    }

    @Override
    public  RTimeSeriesRx getTimeSeries(String name, Codec codec) {
        RTimeSeries timeSeries = new RedissonTimeSeries(codec, evictionScheduler, commandExecutor, name);
        return RxProxyBuilder.create(commandExecutor, timeSeries,
                new RedissonTimeSeriesRx(timeSeries, this), RTimeSeriesRx.class);
    }

    @Override
    public  RTimeSeriesRx getTimeSeries(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RTimeSeries timeSeries = new RedissonTimeSeries<>(params.getCodec(), evictionScheduler, ce, params.getName());
        return RxProxyBuilder.create(commandExecutor, timeSeries,
                new RedissonTimeSeriesRx<>(timeSeries, this), RTimeSeriesRx.class);
    }

    @Override
    public  RSetCacheRx getSetCache(String name) {
        RSetCache set = new RedissonSetCache(evictionScheduler, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonSetCacheRx(set, this), RSetCacheRx.class);
    }

    @Override
    public  RSetCacheRx getSetCache(String name, Codec codec) {
        RSetCache set = new RedissonSetCache(codec, evictionScheduler, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, set, 
                new RedissonSetCacheRx(set, this), RSetCacheRx.class);
    }

    @Override
    public  RSetCacheRx getSetCache(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RSetCache set = new RedissonSetCache(params.getCodec(), evictionScheduler, ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, set,
                new RedissonSetCacheRx(set, this), RSetCacheRx.class);
    }

    @Override
    public RAtomicLongRx getAtomicLong(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonAtomicLong(commandExecutor, name), RAtomicLongRx.class);
    }

    @Override
    public RAtomicLongRx getAtomicLong(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonAtomicLong(ce, params.getName()), RAtomicLongRx.class);
    }

    @Override
    public RAtomicDoubleRx getAtomicDouble(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonAtomicDouble(commandExecutor, name), RAtomicDoubleRx.class);
    }

    @Override
    public RAtomicDoubleRx getAtomicDouble(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonAtomicDouble(ce, params.getName()), RAtomicDoubleRx.class);
    }

    @Override
    public RRemoteService getRemoteService() {
        return getRemoteService("redisson_rs", connectionManager.getServiceManager().getCfg().getCodec());
    }

    @Override
    public RRemoteService getRemoteService(String name) {
        return getRemoteService(name, connectionManager.getServiceManager().getCfg().getCodec());
    }

    @Override
    public RRemoteService getRemoteService(Codec codec) {
        return getRemoteService("redisson_rs", codec);
    }

    @Override
    public RRemoteService getRemoteService(String name, Codec codec) {
        String executorId = connectionManager.getServiceManager().getId();
        if (codec != connectionManager.getServiceManager().getCfg().getCodec()) {
            executorId = executorId + ":" + name;
        }
        return new RedissonRemoteService(codec, name, commandExecutor, executorId);
    }

    @Override
    public RRemoteService getRemoteService(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        String executorId = connectionManager.getServiceManager().getId();
        if (params.getCodec() != null
                && params.getCodec() != connectionManager.getServiceManager().getCfg().getCodec()) {
            executorId = executorId + ":" + params.getName();
        }
        return new RedissonRemoteService(params.getCodec(), params.getName(), commandExecutor, executorId);
    }

    @Override
    public RBitSetRx getBitSet(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBitSet(commandExecutor, name), RBitSetRx.class);
    }

    @Override
    public RBitSetRx getBitSet(CommonOptions options) {
        CommonParams params = (CommonParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonBitSet(ce, params.getName()), RBitSetRx.class);
    }

    @Override
    public  RBloomFilterRx getBloomFilter(String name) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBloomFilter<>(commandExecutor, name), RBloomFilterRx.class);
    }

    @Override
    public  RBloomFilterRx getBloomFilter(String name, Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonBloomFilter<>(codec, commandExecutor, name), RBloomFilterRx.class);
    }

    @Override
    public  RBloomFilterRx getBloomFilter(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor,
                new RedissonBloomFilter(params.getCodec(), ce, params.getName()), RBloomFilterRx.class);
    }

    @Override
    public RFunctionRx getFunction() {
        return RxProxyBuilder.create(commandExecutor, new RedissonFuction(commandExecutor), RFunctionRx.class);
    }

    @Override
    public RFunctionRx getFunction(Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonFuction(commandExecutor, codec), RFunctionRx.class);
    }

    @Override
    public RFunctionRx getFunction(OptionalOptions options) {
        OptionalParams params = (OptionalParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonFuction(ce, params.getCodec()), RFunctionRx.class);
    }

    @Override
    public RScriptRx getScript() {
        return RxProxyBuilder.create(commandExecutor, new RedissonScript(commandExecutor), RScriptRx.class);
    }
    
    @Override
    public RScriptRx getScript(Codec codec) {
        return RxProxyBuilder.create(commandExecutor, new RedissonScript(commandExecutor, codec), RScriptRx.class);
    }

    @Override
    public RScriptRx getScript(OptionalOptions options) {
        OptionalParams params = (OptionalParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonScript(ce, params.getCodec()), RScriptRx.class);
    }

    @Override
    public RBatchRx createBatch() {
        return createBatch(BatchOptions.defaults());
    }
    
    @Override
    public RBatchRx createBatch(BatchOptions options) {
        return new RedissonBatchRx(evictionScheduler, connectionManager, commandExecutor, options);
    }

    @Override
    public RKeysRx getKeys() {
        return RxProxyBuilder.create(commandExecutor, new RedissonKeys(commandExecutor), new RedissonKeysRx(commandExecutor), RKeysRx.class);
    }

    @Override
    public RKeysRx getKeys(KeysOptions options) {
        KeysParams params = (KeysParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        return RxProxyBuilder.create(commandExecutor, new RedissonKeys(ce), new RedissonKeysRx(ce), RKeysRx.class);
    }

    @Override
    public Config getConfig() {
        return connectionManager.getServiceManager().getCfg();
    }

    @Override
    public NodesGroup getNodesGroup() {
        return new RedisNodes(connectionManager, connectionManager.getServiceManager(), commandExecutor);
    }

    @Override
    public NodesGroup getClusterNodesGroup() {
        if (!getConfig().isClusterConfig()) {
            throw new IllegalStateException("Redisson not in cluster mode!");
        }
        return new RedisNodes(connectionManager, connectionManager.getServiceManager(), commandExecutor);
    }

    @Override
    public void shutdown() {
        writeBehindService.stop();
        connectionManager.shutdown();
    }

    @Override
    public boolean isShutdown() {
        return connectionManager.getServiceManager().isShutdown();
    }

    @Override
    public boolean isShuttingDown() {
        return connectionManager.getServiceManager().isShuttingDown();
    }

    @Override
    public  RMapCacheRx getMapCache(String name, Codec codec, MapCacheOptions options) {
        RedissonMapCache map = new RedissonMapCache(codec, evictionScheduler, commandExecutor, name, null, options, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
    }


    @Override
    public  RMapCacheRx getMapCache(String name, MapCacheOptions options) {
        RMap map = new RedissonMapCache(evictionScheduler, commandExecutor, name, null, options, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
    }

    @Override
    public  RMapCacheNativeRx getMapCacheNative(String name) {
        RMap map = new RedissonMapCacheNative<>(commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheNativeRx.class);
    }

    @Override
    public  RMapCacheNativeRx getMapCacheNative(String name, Codec codec) {
        RMap map = new RedissonMapCacheNative<>(codec, commandExecutor, name, null, null, null);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapCacheRx(map, commandExecutor), RMapCacheNativeRx.class);
    }

    @Override
    public  RMapCacheNativeRx getMapCacheNative(org.redisson.api.options.MapOptions options) {
        MapParams params = (MapParams) options;
        MapOptions ops = createOptions(params);

        CommandRxExecutor ce = commandExecutor.copy(params);
        RMap map = new RedissonMapCacheNative<>(params.getCodec(), ce, params.getName(), null, ops, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapCacheRx<>(map, ce), RMapCacheNativeRx.class);
    }

    private static  MapOptions createOptions(MapParams params) {
        MapOptions ops = MapOptions.defaults()
                .loader(params.getLoader())
                .loaderAsync(params.getLoaderAsync())
                .writer(params.getWriter())
                .writerAsync(params.getWriterAsync())
                .writeBehindDelay(params.getWriteBehindDelay())
                .writeBehindBatchSize(params.getWriteBehindBatchSize())
                .writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));

        if (params.getWriteMode() != null) {
            ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
        }
        if (params.getWriteRetryAttempts() > 0) {
            ops.writerRetryAttempts(params.getWriteRetryAttempts());
        }
        return ops;
    }

    @Override
    public  RMapRx getMap(String name, MapOptions options) {
        RMap map = new RedissonMap(commandExecutor, name, null, options, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapRx(map, commandExecutor), RMapRx.class);
    }


    @Override
    public  RMapRx getMap(String name, Codec codec, MapOptions options) {
        RMap map = new RedissonMap(codec, commandExecutor, name, null, options, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map, 
                new RedissonMapRx(map, commandExecutor), RMapRx.class);
    }

    @Override
    public  RLocalCachedMapRx getLocalCachedMap(String name, LocalCachedMapOptions options) {
        return getLocalCachedMap(name, null, options);
    }

    @Override
    public  RLocalCachedMapRx getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) {
        RMap map = new RedissonLocalCachedMap<>(codec, commandExecutor, name, options, evictionScheduler, null, writeBehindService);
        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapRx<>(map, commandExecutor), RLocalCachedMapRx.class);
    }

    @Override
    public  RLocalCachedMapRx getLocalCachedMap(org.redisson.api.options.LocalCachedMapOptions options) {
        LocalCachedMapParams params = (LocalCachedMapParams) options;

        LocalCachedMapOptions ops = LocalCachedMapOptions.defaults()
                .cacheProvider(LocalCachedMapOptions.CacheProvider.valueOf(params.getCacheProvider().toString()))
                .cacheSize(params.getCacheSize())
                .storeMode(LocalCachedMapOptions.StoreMode.valueOf(params.getStoreMode().toString()))
                .evictionPolicy(LocalCachedMapOptions.EvictionPolicy.valueOf(params.getEvictionPolicy().toString()))
                .maxIdle(params.getMaxIdleInMillis())
                .loader(params.getLoader())
                .loaderAsync(params.getLoaderAsync())
                .reconnectionStrategy(LocalCachedMapOptions.ReconnectionStrategy.valueOf(params.getReconnectionStrategy().toString()))
                .storeCacheMiss(params.isStoreCacheMiss())
                .timeToLive(params.getTimeToLiveInMillis())
                .syncStrategy(LocalCachedMapOptions.SyncStrategy.valueOf(params.getSyncStrategy().toString()))
                .useObjectAsCacheKey(params.isUseObjectAsCacheKey())
                .useTopicPattern(params.isUseTopicPattern())
                .expirationEventPolicy(LocalCachedMapOptions.ExpirationEventPolicy.valueOf(params.getExpirationEventPolicy().toString()))
                .writer(params.getWriter())
                .writerAsync(params.getWriterAsync())
                .writeBehindDelay(params.getWriteBehindDelay())
                .writeBehindBatchSize(params.getWriteBehindBatchSize())
                .writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));

        if (params.getWriteMode() != null) {
            ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
        }
        if (params.getWriteRetryAttempts() > 0) {
            ops.writerRetryAttempts(params.getWriteRetryAttempts());
        }

        CommandRxExecutor ce = commandExecutor.copy(params);
        RMap map = new RedissonLocalCachedMap<>(params.getCodec(), ce, params.getName(),
                                ops, evictionScheduler, null, writeBehindService);

        return RxProxyBuilder.create(commandExecutor, map,
                new RedissonMapRx<>(map, ce), RLocalCachedMapRx.class);
    }

    @Override
    public RTransactionRx createTransaction(TransactionOptions options) {
        return new RedissonTransactionRx(commandExecutor, options);
    }

    @Override
    public  RBlockingDequeRx getBlockingDeque(String name) {
        RedissonBlockingDeque deque = new RedissonBlockingDeque(commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, deque, 
                new RedissonBlockingDequeRx(deque), RBlockingDequeRx.class);
    }

    @Override
    public  RBlockingDequeRx getBlockingDeque(String name, Codec codec) {
        RedissonBlockingDeque deque = new RedissonBlockingDeque(codec, commandExecutor, name, null);
        return RxProxyBuilder.create(commandExecutor, deque, 
                new RedissonBlockingDequeRx(deque), RBlockingDequeRx.class);
    }

    @Override
    public  RBlockingDequeRx getBlockingDeque(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonBlockingDeque deque = new RedissonBlockingDeque(params.getCodec(), ce, params.getName(), null);
        return RxProxyBuilder.create(commandExecutor, deque,
                new RedissonBlockingDequeRx(deque), RBlockingDequeRx.class);
    }

    @Override
    public  RTransferQueueRx getTransferQueue(String name) {
        String remoteName = RedissonObject.suffixName(name, "remoteService");
        RRemoteService service = getRemoteService(remoteName);
        RedissonTransferQueue queue = new RedissonTransferQueue(commandExecutor, name, service);
        return RxProxyBuilder.create(commandExecutor, queue,
                new RedissonTransferQueueRx(queue), RTransferQueueRx.class);
    }

    @Override
    public  RTransferQueueRx getTransferQueue(String name, Codec codec) {
        String remoteName = RedissonObject.suffixName(name, "remoteService");
        RRemoteService service = getRemoteService(remoteName);
        RedissonTransferQueue queue = new RedissonTransferQueue(codec, commandExecutor, name, service);
        return RxProxyBuilder.create(commandExecutor, queue,
                new RedissonTransferQueueRx(queue), RTransferQueueRx.class);
    }

    @Override
    public  RTransferQueueRx getTransferQueue(PlainOptions options) {
        PlainParams params = (PlainParams) options;
        String remoteName = RedissonObject.suffixName(params.getName(), "remoteService");
        RRemoteService service = getRemoteService(remoteName);
        CommandRxExecutor ce = commandExecutor.copy(params);
        RedissonTransferQueue queue = new RedissonTransferQueue(params.getCodec(), ce, params.getName(), service);
        return RxProxyBuilder.create(commandExecutor, queue,
                new RedissonTransferQueueRx(queue), RTransferQueueRx.class);
    }

    @Override
    public String getId() {
        return commandExecutor.getServiceManager().getId();
    }
    
}