#1 修改mqtt client id

Sapludināts
wanjing sapludināja 1 revīzijas no develop uz release pirms 1 gada
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java Parādīt failu

@@ -49,7 +49,7 @@ public class MqttProviderConfig {
try {
String ip = IpUtils.getHostIp();
//创建MQTT客户端对象
client = new MqttClient(hostUrl, ip, new MemoryPersistence());
client = new MqttClient(hostUrl, ip + "@" + clientId, new MemoryPersistence());
//连接设置
MqttConnectOptions options = new MqttConnectOptions();
//是否清空session,设置false表示服务器会保留客户端的连接记录(订阅主题,qos),客户端重连之后能获取到服务器在客户端断开连接期间推送的消息

Notiek ielāde…
Atcelt
Saglabāt