Search in sources :

Example 6 with RedisClusterClient

use of io.lettuce.core.cluster.RedisClusterClient in project jetcache by alibaba.

the class RedisLettuceCacheTest method testCluster.

@Test
public void testCluster() throws Exception {
    if (!checkOS()) {
        return;
    }
    RedisURI node1 = RedisURI.create("127.0.0.1", 7000);
    RedisURI node2 = RedisURI.create("127.0.0.1", 7001);
    RedisURI node3 = RedisURI.create("127.0.0.1", 7002);
    RedisClusterClient client = RedisClusterClient.create(Arrays.asList(node1, node2, node3));
    test(client, null);
}
Also used : RedisURI(io.lettuce.core.RedisURI) RedisClusterClient(io.lettuce.core.cluster.RedisClusterClient) LoadingCacheTest(com.alicp.jetcache.LoadingCacheTest) AbstractExternalCacheTest(com.alicp.jetcache.test.external.AbstractExternalCacheTest) Test(org.junit.Test)

Aggregations

RedisClusterClient (io.lettuce.core.cluster.RedisClusterClient)6 Test (org.junit.Test)4 RedisURI (io.lettuce.core.RedisURI)3 LoadingCacheTest (com.alicp.jetcache.LoadingCacheTest)2 AbstractExternalCacheTest (com.alicp.jetcache.test.external.AbstractExternalCacheTest)2 Provides (dagger.Provides)2 Singleton (javax.inject.Singleton)2 RedisLettuceCacheTest (com.alicp.jetcache.redis.lettuce.RedisLettuceCacheTest)1 SpringTest (com.alicp.jetcache.test.spring.SpringTest)1 RedisClient (io.lettuce.core.RedisClient)1 StatefulRedisConnection (io.lettuce.core.api.StatefulRedisConnection)1 RedisAsyncCommands (io.lettuce.core.api.async.RedisAsyncCommands)1 RedisReactiveCommands (io.lettuce.core.api.reactive.RedisReactiveCommands)1 RedisCommands (io.lettuce.core.api.sync.RedisCommands)1 StatefulRedisClusterConnection (io.lettuce.core.cluster.api.StatefulRedisClusterConnection)1 RedisClusterAsyncCommands (io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands)1 RedisClusterReactiveCommands (io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands)1 RedisClusterCommands (io.lettuce.core.cluster.api.sync.RedisClusterCommands)1 Random (java.util.Random)1