|
|
@ -66,7 +66,9 @@ public class MqttSubscriberService {
|
|
|
|
@PreDestroy
|
|
|
|
@PreDestroy
|
|
|
|
private void preDestroy() {
|
|
|
|
private void preDestroy() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
mqttClient.unsubscribe(topicList.toArray(new String[0]));
|
|
|
|
if (topicList.size() > 0) {
|
|
|
|
|
|
|
|
mqttClient.unsubscribe(topicList.toArray(new String[0]));
|
|
|
|
|
|
|
|
}
|
|
|
|
if (mqttClient.isConnected()) {
|
|
|
|
if (mqttClient.isConnected()) {
|
|
|
|
mqttClient.disconnect();
|
|
|
|
mqttClient.disconnect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|