-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
In what version(s) of Spring Integration are you seeing this issue?
5.5.6
Describe the bug
Calling Mqttv5PahoMessageDrivenChannelAdapter.doStop()
does not disconnect and close the underlying IMqttAsyncClient
Lines 187 to 200 in 30bb846
@Override | |
protected void doStop() { | |
this.topicLock.lock(); | |
String[] topics = getTopic(); | |
try { | |
this.mqttClient.unsubscribe(topics).waitForCompletion(getCompletionTimeout()); | |
} | |
catch (MqttException ex) { | |
logger.error(ex, () -> "Error unsubscribing from " + Arrays.toString(topics)); | |
} | |
finally { | |
this.topicLock.unlock(); | |
} | |
} |
Expected behavior
I am not sure if the current behavior is intended or a bug. At least, calling MqttPahoMessageDrivenChannelAdapter.doStop()
does exactly that
Lines 202 to 216 in 30bb846
try { | |
this.client.disconnectForcibly(this.disconnectCompletionTimeout); | |
} | |
catch (MqttException ex) { | |
logger.error(ex, "Exception while disconnecting"); | |
} | |
this.client.setCallback(null); | |
try { | |
this.client.close(); | |
} | |
catch (MqttException ex) { | |
logger.error(ex, "Exception while closing"); | |
} |
If the current behavior is as desired, what do I need to do to disconnect and close the underlying IMqttAsyncClient
?