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