I want to declare Queue and Exchange, which RabbitAdmin instance is being selected if I do not call the setAdminsThatShouldDeclare on Queue or Exchange:
@Bean
public Queue queue() {
Queue queue = new Queue("foo");
// queue.setAdminsThatShouldDeclare(admin1());
return queue;
}
@Bean
public Exchange exchange() {
DirectExchange exchange = new DirectExchange("bar");
// exchange.setAdminsThatShouldDeclare(admin2());
return exchange;
}
There are multiple RabbitMQ connections in the application (multiple RabbitAdmin instances)