Search in sources :

Example 6 with RedissonRxClient

use of org.redisson.api.RedissonRxClient in project redisson by redisson.

the class RedissonBatchRxTest method testBatchBigRequest.

@ParameterizedTest
@MethodSource("data")
public void testBatchBigRequest(BatchOptions batchOptions) {
    Config config = BaseTest.createConfig();
    config.useSingleServer().setTimeout(15000);
    RedissonRxClient redisson = Redisson.create(config).rxJava();
    RBatchRx batch = redisson.createBatch(batchOptions);
    for (int i = 0; i < 210; i++) {
        batch.getMap("test").fastPut("1", "2");
        batch.getMap("test").fastPut("2", "3");
        batch.getMap("test").put("2", "5");
        batch.getAtomicLong("counter").incrementAndGet();
        batch.getAtomicLong("counter").incrementAndGet();
    }
    BatchResult<?> res = sync(batch.execute());
    Assertions.assertEquals(210 * 5, res.getResponses().size());
    redisson.shutdown();
}
Also used : Config(org.redisson.config.Config) RBatchRx(org.redisson.api.RBatchRx) RedissonRxClient(org.redisson.api.RedissonRxClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

RedissonRxClient (org.redisson.api.RedissonRxClient)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 RBatchRx (org.redisson.api.RBatchRx)5 Config (org.redisson.config.Config)5 MethodSource (org.junit.jupiter.params.provider.MethodSource)4 Test (org.junit.jupiter.api.Test)2 ClusterRunner (org.redisson.ClusterRunner)2 ClusterProcesses (org.redisson.ClusterRunner.ClusterProcesses)2 RedisRunner (org.redisson.RedisRunner)2 Completable (io.reactivex.rxjava3.core.Completable)1 IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 BaseTest (org.redisson.BaseTest)1 FailedToStartRedisException (org.redisson.RedisRunner.FailedToStartRedisException)1 BatchOptions (org.redisson.api.BatchOptions)1 RedisException (org.redisson.client.RedisException)1