so,
@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;
}
und ich schlage vor, Sie lesen dieses Dokument https://docs.spring.io/spring-data/data-redis/docs/current/reference/html/#redis:template