use of info.xiancloud.mqttclient.MqttCallbackAdaptor in project xian by happyyangyuan.
the class MqttKeepAlive0Test method testKeepAlive0.
@Test
public void testKeepAlive0() {
MqttCallbackAdaptor callbackAdaptor = new MqttCallbackAdaptor() {
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
LOG.info(topic);
LOG.info(message);
Thread.sleep(Long.MAX_VALUE);
}
};
String queue = IdManager.generateStaticQueueId("happyyangyuan-test-blocking-queue");
node = MqttClientBuilder.newBuilder().id(queue).callback(callbackAdaptor).cleanSession(true).qos(0).keepAliveInterval(0).buildPublisher();
node.connectBroker();
}
Aggregations