فهرست منبع

调整订阅topic顺序

liuyaowen 1 سال پیش
والد
کامیت
b63b8c9e97
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/main/java/com/yunfeiyun/agmp/iots/core/manager/MqttManager.java

+ 2 - 2
src/main/java/com/yunfeiyun/agmp/iots/core/manager/MqttManager.java

@@ -116,8 +116,8 @@ public class MqttManager {
             MqttCore mqttCore = mqttCoreMap.get(connectionId);
             if(null != mqttCore){
                 // MqttCore已经存在
-               mqttCore.subscribe(topics,cfgYf);
-               mqttCore.bindTopicToDeviceId(mqttTopicValues);
+                mqttCore.bindTopicToDeviceId(mqttTopicValues);
+                mqttCore.subscribe(topics,cfgYf);
             }else {
                 // 创建新的mqttCore
                 mqttCore = new MqttCore();