0

I am able to connect to a redis instance by using jedis but not by using redisson.

Here is my jedis configuration:

@Bean
    public JedisConnectionFactory jedisConnectionFactory(@Qualifier("appRedis") final RedisProperties redisProperties){
        RedisStandaloneConfiguration config = new RedisStandaloneConfiguration(redisProperties.getHost(), redisProperties.getPort());
        config.setPassword(RedisPassword.of(EncodeDecodeUtil.decode(redisProperties.getPassword())));
        JedisClientConfiguration.JedisClientConfigurationBuilder jedisClientConfiguration = JedisClientConfiguration.builder();
        jedisClientConfiguration.usePooling();
        jedisClientConfiguration.readTimeout(redisProperties.getTimeout());
        JedisConnectionFactory jedisConnectionFactory =  new JedisConnectionFactory(config, jedisClientConfiguration.build());
        jedisConnectionFactory.getPoolConfig().setMaxIdle(redisProperties.getJedis().getPool().getMaxIdle());
        jedisConnectionFactory.getPoolConfig().setMinIdle(redisProperties.getJedis().getPool().getMinIdle());
        jedisConnectionFactory.getPoolConfig().setMaxTotal(redisProperties.getJedis().getPool().getMaxActive());
        return jedisConnectionFactory;
    }


    @Bean(name = "appRedis")
    public RedisTemplate<String, List<Object>> redisTemplate(RedisConnectionFactory jedisConnectionFactory) {
        RedisTemplate<String, List<Object>> template = new RedisTemplate<>();
        template.setConnectionFactory(jedisConnectionFactory);
        return template;
    }


Yml:

spring:
  data:
  redis:
    host: redishost.hosting.company.net
    password: mypassword
    port: 10790
    jedis:
      pool:
        max-active: 5
        max-idle: 5
        max-wait: -1ms
        min-idle: 3
    connect-timeout: 30000
    timeout: 5000

Redisson Configuration:

@Bean
public RedissonClient client(){
    Config config = new Config();
    config.useSingleServer().
            setAddress("redis://redishost.hosting.company.net:10790")
    .setPassword("mypassword");
    RedissonClient client = Redisson.create(config);
    return client;
}

I am getting the error:

WRONGPASS invalid username-password pair

I am trying to use a basic configuration for redisson to do trial and error. I am just setting basic config parameters such as address, password and port

2
  • Did you resolve the issue? Commented Feb 5, 2021 at 6:15
  • 1
    max-wait: -1ms i think that is the issue Commented Mar 20, 2021 at 11:47

1 Answer 1

0

You need to connect by providing username.

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.