Reputation: 1006
Now I can do like this:
@RabbitListener(queues = {ENTITY_KEY + "-snapshots", ENTITY_KEY + "-updates"})
public void handleMessage(ProviderOddsOffer offer, @Header("update_type") Long updateType) {
...
}
Can I do it without declaring queues in annotation itself?
Upvotes: 2
Views: 1593
Reputation: 174494
It's not clear what you mean; the listener has to be configured to consume from some queue, or queues.
If you that mean you wish to externalize the queue name(s) rather than hard-coding in java, you can use a property placeholder ${...} or a SpEL expression #{...} for the queue name(s); they will be resolved during bean initialization.
Upvotes: 3