List of usage examples for org.springframework.data.redis.core RedisTemplate RedisTemplate
public RedisTemplate()
RedisTemplate
instance. From source file:com.enitalk.configs.RedisConfig.java
@Bean @Primary// w ww . java2 s. com public RedisTemplate<String, String> redisTemplate() { RedisTemplate<String, String> redisTemplate = new RedisTemplate<>(); redisTemplate.setConnectionFactory(jedisConnectionFactory()); redisTemplate.setKeySerializer(redisSerializer()); redisTemplate.setHashKeySerializer(redisSerializer()); redisTemplate.setHashValueSerializer(redisSerializer()); return redisTemplate; }
From source file:stormy.pythian.service.spring.ServiceConfiguration.java
@Bean public RedisTemplate<String, PythianToplogyConfiguration> redisTopologyTemplate() { RedisTemplate<String, PythianToplogyConfiguration> template = new RedisTemplate<>(); template.setConnectionFactory(redisConnectionFactory()); template.setKeySerializer(new StringRedisSerializer()); template.setHashKeySerializer(new StringRedisSerializer()); template.setHashValueSerializer(new JacksonJsonRedisSerializer<>(PythianToplogyConfiguration.class)); return template; }
From source file:org.encos.flydown.limiters.cache.impl.RedisRatingCache.java
@SuppressWarnings("unchecked") public RedisRatingCache(JedisConnectionFactory jedisConnectionFactory) { cacheTemplate = new RedisTemplate(); cacheTemplate.setConnectionFactory(jedisConnectionFactory); }
From source file:com.vcredit.lrh.db.redis.RedisCacheConfiguration.java
@Bean(name = "redisTemplate") public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); redisTemplate.setConnectionFactory(redisConnectionFactory); return redisTemplate; }
From source file:org.cloudfoundry.community.servicebroker.vrealize.CloudConfig.java
@Bean @Qualifier("siTemplate") RedisTemplate<String, VrServiceInstance> siTemplate() { RedisTemplate<String, VrServiceInstance> template = new RedisTemplate<String, VrServiceInstance>(); template.setConnectionFactory(jedisConnectionFactory()); return template; }
From source file:lab.home.mvn_tomcat_spring_redis_rest_api.config.SpringRedisConfig.java
@Bean RedisTemplate<String, Object> redisTemplate() { final RedisTemplate<String, Object> template = new RedisTemplate<>(); template.setConnectionFactory(jedisConnectionFactory()); template.setKeySerializer(new StringRedisSerializer()); template.setHashValueSerializer(new GenericToStringSerializer<>(Object.class)); template.setValueSerializer(new GenericToStringSerializer<>(Object.class)); return template; }
From source file:io.pivotal.ecosystem.servicebroker.Config.java
@Bean RedisTemplate<String, ServiceBinding> bindingTemplate(RedisConnectionFactory redisConnectionFactory) { RedisTemplate<String, ServiceBinding> template = new RedisTemplate<>(); template.setConnectionFactory(redisConnectionFactory); return template; }
From source file:lab.home.spring.redis.test.RedisTestConfig.java
@Bean RedisTemplate<String, Object> redisTemplate() { final RedisTemplate<String, Object> template = new RedisTemplate<String, Object>(); template.setConnectionFactory(jedisConnectionFactory()); template.setKeySerializer(new StringRedisSerializer()); template.setHashValueSerializer(new GenericToStringSerializer<Object>(Object.class)); template.setValueSerializer(new GenericToStringSerializer<Object>(Object.class)); return template; }
From source file:com.miko.demo.mongo.service.RedisRemovalTest.java
@Test public void removalKeyValueTest() { RedisTemplate<String, Long> redis = new RedisTemplate<>(); redis.setConnectionFactory(connectionFactory); redis.setKeySerializer(RedisStringSerializer.INSTANCE); redis.setValueSerializer(RedisLongSerializer.INSTANCE); redis.afterPropertiesSet();/* www . j a v a 2 s . com*/ ValueOperations<String, Long> ops = redis.opsForValue(); String key1 = "miko-spring-mongo:counter-test"; String key2 = "miko-spring-mongo:counter-test-2"; Set<String> keys = redis.keys(key1); for (String foundKey : keys) { logger.debug("Found Key= " + foundKey + " value= " + ops.get(foundKey)); } redis.delete(key2); }
From source file:cn.org.once.cstack.config.CacheConfiguration.java
@Bean public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory cf) { RedisTemplate<String, String> redisTemplate = new RedisTemplate<String, String>(); redisTemplate.setHashKeySerializer(new StringRedisSerializer()); redisTemplate.setConnectionFactory(cf); return redisTemplate; }