Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
@JmsListener with autoStartup=false will never start [SPR-14105] #18677
Hence, initializing with auto startup false, means the containers can never start.
Work around is to loop over the containers, and change the
Or you can iterate over the containers to start instead of invoking
Stéphane Nicoll commented
I am still confused by that bug report to be honest.
Containers are created by the registry. Since containers are no Spring Beans (see the class Javadoc), the registry makes sure to honour the container lifecycle callback. I had a look to the related stackoverflow thread and what you suggested as a workaround is exactly what the user should be doing IMO.
If you configure
What am I missing Gary Russell?
Gary Russell commented
Stéphane Nicoll The real issue is inconsistency with when the initial value is
The fact that
I think the real flaw is that the registry itself always returns true for auto-startup; that is what should control whether the containers are started when the context is refreshed. i.e. the lifecycle of the registered containers should be controlled by the lifecycle of the registry, the registry should not care about the delegate states - as you said, they are not beans.
This is how I fixed it for
One more point - I think users would have a reasonable expectation that