DefaultMessageListenerContainer immediately invokes stop callback when not running
Issue: SPR-14233
This commit is contained in:
parent
29da44c8dc
commit
e45d33f9de
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue