Skip to content

Connection configuration per environment error in Grails 2.1 #15

Closed

Description

@apsegian

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions