I have recently run into a problem with trying to make the topic of my JMS @Subscriber a variable based upon environment. Currently, I have in my config.groovy:
environments {
development {
jms.foo.msg = "my.jms.topic.dev.1_0"
}
test {
jms.foo.msg = "my.jms.topic.tst.1_0"
}
production {
jms.foo.msg = "my.jms.topic.prd.1_0"
}
}
And in my service, where I have my @Subscriber, I have this:
@Subscriber(
topic = grailsApplication.config.jms.foo.msg,
container = 'matter',
adapter = 'durable'
)
The error that I am getting is: "Expected 'grailsApplication.config.jms.foo.msg' to be an inline constant."
I have tried many variations of getting the config value here. All I am looking for is how to subscribe to the proper topic while on a specific environment. Any ideas are appreciated.