Skip to content

Consumer failed to start in XX milliseconds, SimpleMessageListenerContainer abnormal shut down  #1487

Closed
@renyansongno1

Description

@renyansongno1

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

  1. thread a invoke SimpleMessageListenerContainer.addQueues
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions