|
@@ -92,14 +92,6 @@ public class MqttClientUtil implements ApplicationRunner {
|
|
|
options.setMaxReconnectDelay(128000);
|
|
|
// 允许的最大传输中消息
|
|
|
options.setMaxInflight(100);
|
|
|
- // 设置“遗嘱”消息的话题,若客户端与服务器之间的连接意外中断,服务器将发布客户端的“遗嘱”消息。
|
|
|
- //获取所有主题
|
|
|
- String[] topics = configMqtt.getTopic().split(",");
|
|
|
- if(topics!=null&&topics.length!=0){
|
|
|
- for (String topic : topics) {
|
|
|
- options.setWill(Arrays.toString(topics), "offline".getBytes(), 2, false);
|
|
|
- }
|
|
|
- }
|
|
|
//创建连接对象
|
|
|
client = new MqttClient(url.toString(), configMqtt.getId(), new MemoryPersistence());
|
|
|
//设置回调对象
|