mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
更新yml配置
This commit is contained in:
@@ -83,10 +83,11 @@ spring:
|
|||||||
username: wumei-smart # 账号
|
username: wumei-smart # 账号
|
||||||
password: wumei-smart # 密码
|
password: wumei-smart # 密码
|
||||||
host-url: tcp://localhost:1883 # mqtt连接tcp地址
|
host-url: tcp://localhost:1883 # mqtt连接tcp地址
|
||||||
client-id: ${random.int} # 客户端Id,不能相同,采用随机数 ${random.value}
|
client-id: ${random.int} # 客户端Id,不能相同,采用随机数 ${random.value}
|
||||||
default-topic: test # 默认主题
|
default-topic: test # 默认主题
|
||||||
timeout: 30000 # 超时时间
|
timeout: 30000 # 超时时间
|
||||||
keepalive: 30 # 保持连接
|
keepalive: 30 # 保持连接
|
||||||
|
clearSession: true # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息)
|
||||||
task:
|
task:
|
||||||
execution:
|
execution:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@@ -117,8 +117,6 @@ public class EmqxClient {
|
|||||||
options.setKeepAliveInterval(keepalive);
|
options.setKeepAliveInterval(keepalive);
|
||||||
//设置自动重新连接
|
//设置自动重新连接
|
||||||
options.setAutomaticReconnect(true);
|
options.setAutomaticReconnect(true);
|
||||||
/*设置为false,断开连接,不清除session,重连后还是原来的session
|
|
||||||
保留订阅的主题,能接收离线期间的消息*/
|
|
||||||
options.setCleanSession(clearSession);
|
options.setCleanSession(clearSession);
|
||||||
logger.debug("====>>>>设置mqtt参数成功");
|
logger.debug("====>>>>设置mqtt参数成功");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user