I updated my application to Spring Boot 2.1.0 and Java 11. Since then my Redis is not working anymore.
When I call findById()
and the result is empty then there are no problems.
When I call findById()
and there is a result then the application / thread is stuck at this point and nothing happens.
When I use Spring Boot 2.0.6 and Java 9 the same code is working well.
I tried to use LettuceConnectionFactory
and JedisConnectionFactory
with the same result.
My Redis Config:
@Configuration
@EnableRedisRepositories
public class RedisConfiguration {
@Bean
RedisConnectionFactory connectionFactory() {
return new LettuceConnectionFactory();
}
@Bean
@Primary
RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);
template.setKeySerializer(new StringRedisSerializer());
template.setValueSerializer(new GenericJackson2JsonRedisSerializer());
return template;
}
}
My entity:
@Value
@RedisHash("token")
public class Token {
@Id
private String key;
private String value;
@TimeToLive
private Long expiration;
}
My repository just extends the CrudRepository
and I'm only using provided methods.
Redis-Server version is Redis server v=4.0.9
running on OSX (dev) / Ubuntu (test).
Did I miss some changes I have to apply to use Java 11 / Boot 2.1 ?