We are migrating from existing classic queues to quorum queues and one of the requirements is that we must declare queue usage as "passive" (i.e. queueDeclarePassive). The intent is to ensure we do not create any queues dynamically and only check for its existence (and fail if it doesn't exist) and then connect.
We have a legacy service that uses spring-amqp and we set the SimpleMessageListenerContainer like so:
SimpleMessageListenerContainer container(ConnectionFactory connectionFactory, MessageListenerAdapter listenerAdapter) {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
container.setQueueNames(queue().getName());
...
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.getConnectionFactory().createConnection().createChannel(false);
return rabbitTemplate;
}
I don't see a way to declare the queue as "passive". In reading the spring.io documentation, I see a description for declarationRetries:
"The number of retry attempts when passive queue declaration fails. Passive queue declaration occurs when the consumer starts or, when consuming from multiple queues, when not all queues were available during initialization."
Does this imply that spring-amqp uses queueDeclarePassive behind the scenes? Is this explicitly documented anywhere? If I'm incorrect, how do I properly ensure queueDeclarePassive is used within this amqp usage?
Thanks in advance!