use of org.springframework.data.redis.core.RedisTemplate 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);
}
}
use of org.springframework.data.redis.core.RedisTemplate 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;
}
use of org.springframework.data.redis.core.RedisTemplate in project spring-boot by spring-projects.
the class RedisUtils method createRedisTemplate.
static <K, V> RedisTemplate<K, V> createRedisTemplate(RedisConnectionFactory connectionFactory, Class<V> valueClass) {
RedisTemplate<K, V> redisTemplate = new RedisTemplate<>();
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new GenericToStringSerializer<>(valueClass));
// avoids proxy
redisTemplate.setExposeConnection(true);
redisTemplate.setConnectionFactory(connectionFactory);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
use of org.springframework.data.redis.core.RedisTemplate in project spring-boot-mybatis-with-redis by Lovelcp.
the class RedisCache method removeObject.
/**
* Remove cached query result from redis
*
* @param key
* @return
*/
@Override
@SuppressWarnings("unchecked")
public Object removeObject(Object key) {
RedisTemplate redisTemplate = getRedisTemplate();
redisTemplate.delete(key);
logger.debug("Remove cached query result from redis");
return null;
}
use of org.springframework.data.redis.core.RedisTemplate in project camel by apache.
the class RedisStringIdempotentRepositoryIntegrationTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(CONNECTION_FACTORY);
redisTemplate.afterPropertiesSet();
registry.bind("redisTemplate", redisTemplate);
return registry;
}
Aggregations