From spring boot tutorial: https://spring.io/guides/gs/messaging-rabbitmq/
They give an example of creating 1 queue and 1 queue only, but, what if I want to be able to create more then 1 queue? how would it be possible?
Obviously, I can't just create the same bean twice:
@Bean
Queue queue() {
return new Queue(queueNameAAA, false);
}
@Bean
Queue queue() {
return new Queue(queueNameBBB, false);
}
You can't create the same bean twice, it will make ambiguous.
Give the bean definition factory methods different names. Usually, by convention, you would name them the same as the queue, but that's not required...
The method name is the bean name.
EDIT
When using the queues in the binding beans, there are two options:
or
or even better...