From 27f3e54bf4322fa1c054a6b02cab8e1dcbd43eff Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 28 Nov 2022 12:15:33 -0500 Subject: [PATCH] GH-1541: Fix Container Docs Resolves https://github.com/spring-projects/spring-amqp/issues/1541 Containers can have zero queues. --- src/reference/asciidoc/amqp.adoc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/reference/asciidoc/amqp.adoc b/src/reference/asciidoc/amqp.adoc index 90062b4d..69b94e0e 100644 --- a/src/reference/asciidoc/amqp.adoc +++ b/src/reference/asciidoc/amqp.adoc @@ -6629,15 +6629,12 @@ When using exclusive consumers, other containers try to consume from the queues Version 1.3 introduced a number of improvements for handling multiple queues in a listener container. -The container must be configured to listen on at least one queue. -This was the case previously, too, but now queues can be added and removed at runtime. -The container recycles (cancels and re-creates) the consumers when any pre-fetched messages have been processed. +Container can be initially configured to listen on zero queues. +Queues can be added and removed at runtime. +The `SimpleMessageListenerContainer` recycles (cancels and re-creates) all consumers when any pre-fetched messages have been processed. +The `DirectMessageListenerContainer` creates/cancels individual consumer(s) for each queue without affecting consumers on other queues. See the https://docs.spring.io/spring-amqp/docs/latest-ga/api/org/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer.html[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods. -When removing queues, at least one queue must remain. -A consumer now starts if any of its queues are available. -Previously, the container would stop if any queues were unavailable. -Now, this is only the case if none of the queues are available. If not all queues are available, the container tries to passively declare (and consume from) the missing queues every 60 seconds. Also, if a consumer receives a cancel from the broker (for example, if a queue is deleted) the consumer tries to recover, and the recovered consumer continues to process messages from any other configured queues.