Skip to content

RedisAutoConfiguration doesn't use server details set in properties file if using pooled connection #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adnansorg opened this issue May 13, 2014 · 0 comments
Labels
type: bug A general bug
Milestone

Comments

@adnansorg
Copy link

If using custom redis properties in the application.properties or yaml equivalent, RedisAutoConfiguration doesn't use these settings when using RedisPooledConnectionConfiguration.redisConnectionFactory ().

if (this.properties.getPool() != null) {
    JedisConnectionFactory factory = new JedisConnectionFactory(
            jedisPoolConfig());
    return factory;
}

It needs to set the factory config from properties file.

if (this.properties.getPool() != null) {
    JedisConnectionFactory factory = new JedisConnectionFactory(
            jedisPoolConfig());
    factory.setHostName(this.properties.getHost());
    factory.setPort(this.properties.getPort());
    if (this.properties.getPassword() != null) {
        factory.setPassword(this.properties.getPassword());
    }                
    return factory;
}

Otherwise it uses JedisConnectionFactory defaults which is always localhost and throws connection errors if you're using something other than localhost.

@cdupuis cdupuis self-assigned this May 13, 2014
@cdupuis cdupuis modified the milestones: 1.1.0.M2, 1.0.3 May 13, 2014
@dsyer dsyer removed the ready label May 30, 2014
mdeinum pushed a commit to mdeinum/spring-boot that referenced this issue Jun 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants