use of org.springframework.data.redis.serializer.StringRedisSerializer in project benchmark by seelunzi.
the class RedisConfig method redisTemplate.
@Bean
public RedisTemplate<String, Serializable> redisTemplate() {
RedisTemplate<String, Serializable> template = new RedisTemplate<String, Serializable>();
template.setConnectionFactory(jedisConnectionFactory());
template.setKeySerializer(new StringRedisSerializer());
template.setValueSerializer(new RedisObjectSerializer());
return template;
}
use of org.springframework.data.redis.serializer.StringRedisSerializer in project rdbcache by rdbcache.
the class RedisConfig method redisKeyInfoTemplate.
@Bean
public RedisKeyInfoTemplate redisKeyInfoTemplate() {
RedisKeyInfoTemplate template = new RedisKeyInfoTemplate();
template.setConnectionFactory(redisConnectionFactory());
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(new Jackson2JsonRedisSerializer<KeyInfo>(KeyInfo.class));
return template;
}
use of org.springframework.data.redis.serializer.StringRedisSerializer in project WTFDYUM by jchampemont.
the class RedisConfiguration method longRedisTemplate.
@Bean
public RedisTemplate<String, Long> longRedisTemplate() {
final RedisTemplate<String, Long> template = new RedisTemplate<>();
template.setConnectionFactory(redisConnectionFactory());
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new LongRedisSerializer());
template.setValueSerializer(new LongRedisSerializer());
return template;
}
use of org.springframework.data.redis.serializer.StringRedisSerializer in project WTFDYUM by jchampemont.
the class RedisConfiguration method eventRedisTemplate.
@Bean
public RedisTemplate<String, Event> eventRedisTemplate() {
final RedisTemplate<String, Event> template = new RedisTemplate<>();
template.setConnectionFactory(redisConnectionFactory());
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(jsonSerializer(Event.class, objectMapper()));
template.setValueSerializer(jsonSerializer(Event.class, objectMapper()));
return template;
}
use of org.springframework.data.redis.serializer.StringRedisSerializer in project WTFDYUM by jchampemont.
the class RedisConfiguration method principalRedisTemplate.
@Bean
public RedisTemplate<String, Principal> principalRedisTemplate() {
final RedisTemplate<String, Principal> template = new RedisTemplate<>();
template.setConnectionFactory(redisConnectionFactory());
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(jsonSerializer(Principal.class, objectMapper()));
template.setValueSerializer(jsonSerializer(Principal.class, objectMapper()));
return template;
}
Aggregations