ServerRun.java 479 B

12345678910111213141516171819
  1. package com.xyhy.jiaranmqttcluster;
  2. import com.xyhy.jiaranmqttcluster.common.Common;
  3. import com.xyhy.jiaranmqttcluster.common.mqtt.MqttServer;
  4. import org.springframework.boot.CommandLineRunner;
  5. import org.springframework.stereotype.Component;
  6. @Component
  7. public class ServerRun extends Common implements CommandLineRunner {
  8. @Override
  9. public void run(String... args) throws Exception {
  10. //MQTT server 启动
  11. MqttServer.getInstance().connect();
  12. }
  13. }