spring-projects/spring-amqp — pull request #162 by garyrussell (2014-02-06 23:44:52+00:00)
Title: AMQP-312/372 Listner Container Queue Improvements

JIRA: https://jira.springsource.org/browse/AMQP-312

Support adding/removing queues at runtime.

Previously, the `SimpleMessageListenerContainer` had to be stopped
and restarted to change the queues on which it is listening.

`addQueueName()`, `addQueue()`, `removeQueueName()` and
`removeQueue()` methods are now available. In addition,
the `setQueueNames()` and `setQueues()` methods can be called
after initialization.

In each case, when the queues are changed, existing consumers
are recycled (cancelled and restarted) after any pre-fetched
messages are processed.

JIRA: https://jira.springsource.org/browse/AMQP-372

Previously, when a container is configured to listen to multiple
queues, the container would fail to start if any of its queues
were not available.

With this change, the container will start and listen to those
queues that are available, and attempt to consume from the missing
queues every 60 seconds.

In addition, if a consumer is cancelled (for example, if a queue
is deleted), the consumer will be recycled (cancelled and
restarted) and, again go into recovery mode where it will
attempt to consume from the deleted queue every 60 seconds.