Explorar el Código

调整订阅topic顺序

liuyaowen hace 1 año
padre
commit
b63b8c9e97

+ 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();