Search in sources :

Example 1 with LongRedisSerializer

use of com.jeanchampemont.wtfdyum.utils.LongRedisSerializer 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;
}
Also used : LongRedisSerializer(com.jeanchampemont.wtfdyum.utils.LongRedisSerializer) StringRedisSerializer(org.springframework.data.redis.serializer.StringRedisSerializer) RedisTemplate(org.springframework.data.redis.core.RedisTemplate) Bean(org.springframework.context.annotation.Bean)

Aggregations

LongRedisSerializer (com.jeanchampemont.wtfdyum.utils.LongRedisSerializer)1 Bean (org.springframework.context.annotation.Bean)1 RedisTemplate (org.springframework.data.redis.core.RedisTemplate)1 StringRedisSerializer (org.springframework.data.redis.serializer.StringRedisSerializer)1