I'm using redis in one of my java apps and I'm serializing a list of objects to be stored in Redis. However, I noticed that using the RedisTemplate would use the JdkSerializationRedisSerializer. Instead, I'd like to use Jackson to serialize since I believe it is better for speed. How would I go about configuring my RedisTemplate to use Jackson instead?
For clarification, this is how I'm configuring my RedisTemplate:
@Override
protected RedisConfiguration getRedisConfiguration() {
return redisConfiguration;
}
@Bean
public RedisTemplate<String, Object> getRedisTemplate() {
RedisTemplate<String, Object> template = new RedisTemplate<>();
template.setConnectionFactory(jedisConnectionFactory());
return template;
}