Description
In what version(s) of Spring AMQP are you seeing this issue?
every version
Describe the bug
We use the SimpleMessageListenerContainer to dynamically create consumer(listen some queue) when we receive some signal,
but If in the process of adding (addQueues(Queue... queue)), the spring context is destroyed(shutdown the program). so there will be some exception here: Consumer failed to start in XX milliseconds; does the task executor have enough threads to support the container concurrency?
This exception is very unclear, we find the SimpleMessageListenerContainer is getting the thread start result, but now thread get the spring context was destroyed, so return, the AsyncMessageProcessingConsumer is not called CountDownLatch.countdown.
so we think there's a bug here, we should call countdown in all cases
To Reproduce
- thread a invoke SimpleMessageListenerContainer.addQueues
- thread b close the spring context
Expected behavior
context close now, do not report "Consumer failed to start in XX milliseconds; does the task executor have enough threads to support the container concurrency?"
Sample