Browse Source

bug修复

zghww 2 months ago
parent
commit
3bf9ad6e13

+ 4 - 2
data-adapter/src/main/java/com/gyee/dataadapter/controller/SubscribeController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.concurrent.CompletableFuture;
 
 @RestController
 @RequestMapping(value = "/subscribe")
@@ -24,8 +25,9 @@ public class SubscribeController implements ApplicationRunner {
 
     @Override
     public void run(ApplicationArguments args) {
-
-        mqttserver.init(topic, qos);
+        CompletableFuture.runAsync(() -> {
+            mqttserver.init(topic, qos);
+        });
     }