DefaultMessageListenerContainer immediately invokes stop callback when not running
Issue: SPR-14233
This commit is contained in:
@@ -614,6 +614,12 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
|||||||
@Override
|
@Override
|
||||||
public void stop(Runnable callback) throws JmsException {
|
public void stop(Runnable callback) throws JmsException {
|
||||||
synchronized (this.lifecycleMonitor) {
|
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;
|
this.stopCallback = callback;
|
||||||
}
|
}
|
||||||
stop();
|
stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user