mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
DefaultMessageListenerContainer immediately invokes stop callback when not running
Issue: SPR-14233
This commit is contained in:
+6
@@ -614,6 +614,12 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
||||
@Override
|
||||
public void stop(Runnable callback) throws JmsException {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
if (!isRunning() || this.stopCallback != null) {
|
||||
// Not started, already stopped, or previous stop attempt in progress
|
||||
// -> return immediately, no stop process to control anymore.
|
||||
callback.run();
|
||||
return;
|
||||
}
|
||||
this.stopCallback = callback;
|
||||
}
|
||||
stop();
|
||||
|
||||
Reference in New Issue
Block a user