Reputation: 793
I'm using the @MessageMapping annotation to poll my SQS queue. No problems here, however. I have a general question regarding changing the queue name depending on app environment.
Lets say that locally, in my test environment I want my @MessageMapping annotation to poll from a "Development queue name" but when I deploy to production I want to change the @MessageMapping value to a "production queue name".
@MessageMapping(ENV_SPECIFIC_QUEUE_NAME)
public void poll(String payload) {
//do something
}
Is there a way this can be achieved through config?
Upvotes: 1
Views: 1125
Reputation: 971
For the moment it's no possible to dynamically set a queue name on a @MessageMapping annotation. I opened an issue to allow the usage of a property that would be set by the property placeholder.
In the meantime I recommend you to work with a CloudFormation template. With this solution you can use the logical queue name that you defined in your template and it will automatically be resolved to its physical name. Integration with CloudFormation is described here. With this solution you can start multiple stacks with the same template (dev, integration, prod,...) and you won't have any issues with queue names.
Upvotes: 0