Skip to content
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

Connection configuration per environment error in Grails 2.1 #15

Open
apsegian opened this issue Aug 8, 2012 · 0 comments
Open

Connection configuration per environment error in Grails 2.1 #15

apsegian opened this issue Aug 8, 2012 · 0 comments

Comments

@apsegian
Copy link

apsegian commented Aug 8, 2012

The use case is to configure the redis connections different for each environment using Grails 2.1 . Enhancing the default grails Config.groovy I used the following configuration:

environments {
development {
grails.logging.jul.usebridge = true
redis {
poolConfig {
maxActive=128
minIdle=4
}
port = 6379
host = "localhost"
connections {
objectsCache {
port = 6378
host = "localhost"
}
streamsCache {
port = 6378
host = "localhost"
}
pubsub {
port = 6379
host = "localhost"
}

        }
    }
}
production {
    grails.logging.jul.usebridge = false
    redis {
        poolConfig {
            maxActive=16
            minIdle=4
        }
        connections {
            objectsCache {
                port = 6379
                host = "server1"
            }
            streamsCache {
                port = 6379
                host = "server2"
            }
            pubsub {
                port = 6379
                host = "server3"
            }
        }
    }
}

}

The problem is that enviroments in Grails 2.1 is not under grails{ } , so in RedisGrailsPlugin:
line 59 : def redisConfigMap = application.config.grails.redis ?: [:]

the redisConfigMap is always empty. I overcame the problem changing this line to:

  • def redisConfigMap = application.config.redis ?: [:]

Thank you for the great job,
Tassos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant