2015-11-20 20:54:27 +01:00
|
|
|
package io.moquette.testembedded;
|
2015-08-18 23:49:05 +02:00
|
|
|
|
2015-11-20 20:54:27 +01:00
|
|
|
import io.moquette.server.Server;
|
|
|
|
|
import io.moquette.server.config.IConfig;
|
|
|
|
|
import io.moquette.server.config.ClasspathConfig;
|
2015-08-18 23:49:05 +02:00
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
public class EmbeddedLauncher {
|
|
|
|
|
public static void main(String[] args) throws InterruptedException, IOException {
|
2015-08-22 15:35:11 +02:00
|
|
|
final IConfig classPathConfig = new ClasspathConfig();
|
|
|
|
|
|
2015-08-18 23:49:05 +02:00
|
|
|
final Server mqttBroker = new Server();
|
2015-08-22 15:35:11 +02:00
|
|
|
mqttBroker.startServer(classPathConfig);
|
2015-08-18 23:49:05 +02:00
|
|
|
System.out.println("Broker started");
|
|
|
|
|
Thread.sleep(1000);
|
|
|
|
|
System.out.println("Stopping broker");
|
|
|
|
|
mqttBroker.stopServer();
|
|
|
|
|
System.out.println("Broker stopped");
|
|
|
|
|
}
|
|
|
|
|
}
|