Open
Description
Describe the bug
"The RedisIndexedSessionRepository has a method called resolveDatabase() that retrieves the Redis database currently in use. However, when using Redisson, it always returns DEFAULT_DATABASE. This is because Redisson implements a different RedisConnectionFactory named org.redisson.spring.data.connection.RedissonConnectionFactory
private int resolveDatabase() {
if (ClassUtils.isPresent("io.lettuce.core.RedisClient", null)
&& getRedisConnectionFactory() instanceof LettuceConnectionFactory) {
return ((LettuceConnectionFactory) getRedisConnectionFactory()).getDatabase();
}
if (ClassUtils.isPresent("redis.clients.jedis.Jedis", null)
&& getRedisConnectionFactory() instanceof JedisConnectionFactory) {
return ((JedisConnectionFactory) getRedisConnectionFactory()).getDatabase();
}
return RedisIndexedSessionRepository.DEFAULT_DATABASE;
}