Given the following Queue
(RabbitMQ) bean in Spring Boot...
@Bean
Queue exampleQueue() {
return QueueBuilder.durable("exampleQueue")
.quorum()
.singleActiveConsumer()
.build();
}
@Bean
public DirectExchange directExchange() {
return ExchangeBuilder.directExchange("direct-exchange")
.durable(true)
.build();
}
... I found the following Binding
definition in the code I'm reviewing:
@Bean
Binding exampleBinding(DirectExchange directExchange, Queue exampleQueue) {
final Binding binding = BindingBuilder.bind(exampleQueue)
.to(directExchange)
.with("example-routing-key");
binding.addArgument("x-queue-type", "quorum");
binding.addArgument("x-single-active-consumer", "true");
return binding;
}
My question is: Are these additional arguments x-queue-type
and x-single-active-consumer
necessary at all? My understanding is, that the queue already defines these settings and, thus, the binding does not to explicitly repeat them?
Those are queue arguments, not binding arguments so, no, they are not necessary; presumably RabbitMQ just ignores them.