zghww преди 2 месеца
родител
ревизия
3bf9ad6e13
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      data-adapter/src/main/java/com/gyee/dataadapter/controller/SubscribeController.java

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