zoals dit,
@Bean
public RedisTemplate<String, Object> getRedisTemplate() {
RedisTemplate<String, Object> template = new RedisTemplate<>();
Jackson2JsonRedisSerializer jrs = new Jackson2JsonRedisSerializer(String.class);
template.setKeySerializer(jrs);
template.setConnectionFactory(jedisConnectionFactory());
return template;
}
en ik raad u aan dit document te lezenhttps://docs.spring.io/spring-data/data-redis/docs/current/reference/html/#redis:template