Search in sources :

Example 1 with DefaultRedisList

use of org.springframework.data.redis.support.collections.DefaultRedisList in project roof-im by madfroglx.

the class RedisBlockingQueueRequestMessageDriveEnterPoint method onInit.

@Override
protected void onInit() {
    this.queues = new ArrayList();
    for (RedisTemplate redisTemplate : redisTemplates) {
        RedisList<E> redisList = new DefaultRedisList<E>(redisTemplate.boundListOps(serverNameBuilder.getName()));
        this.queues.add(redisList);
    }
}
Also used : RedisTemplate(org.springframework.data.redis.core.RedisTemplate) DefaultRedisList(org.springframework.data.redis.support.collections.DefaultRedisList) ArrayList(java.util.ArrayList)

Example 2 with DefaultRedisList

use of org.springframework.data.redis.support.collections.DefaultRedisList in project roof-im by madfroglx.

the class RedisBlockingQueueLoadBalanceMessagePublisher method createQueues.

@Override
protected List<BlockingQueue> createQueues(String serverName) {
    List<BlockingQueue> list = new ArrayList<>();
    for (RedisTemplate redisTemplate : redisTemplates) {
        BoundListOperations boundListOperations = redisTemplate.boundListOps(serverName);
        BlockingQueue blockingQueue = new DefaultRedisList(boundListOperations);
        list.add(blockingQueue);
    }
    return list;
}
Also used : BlockingQueue(java.util.concurrent.BlockingQueue) BoundListOperations(org.springframework.data.redis.core.BoundListOperations) RedisTemplate(org.springframework.data.redis.core.RedisTemplate) DefaultRedisList(org.springframework.data.redis.support.collections.DefaultRedisList) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)2 RedisTemplate (org.springframework.data.redis.core.RedisTemplate)2 DefaultRedisList (org.springframework.data.redis.support.collections.DefaultRedisList)2 BlockingQueue (java.util.concurrent.BlockingQueue)1 BoundListOperations (org.springframework.data.redis.core.BoundListOperations)1