Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Mar 4, 2025
2 parents 19dfef9 + 83e42df commit 0dad8a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class MqttClientDisconnectListener implements EventListener<MqttDisconnec

@Override
public void onEvent(MqttDisconnectEvent mqttDisconnectEvent) throws Throwable {
logger.info("MqttDisconnectEvent:{}", mqttDisconnectEvent);
// 在断线时更新 clientId、username、password
mqttClientCreator.clientId("newClient" + System.currentTimeMillis())
.username("newUserName")
.password("newPassword");
logger.info("MqttDisconnectEvent:{}", mqttDisconnectEvent);
// 在断线时更新 clientId、username、password,只能改这 3 个,不可调用其他方法。
// mqttClientCreator.clientId("newClient" + System.currentTimeMillis())
// .username("newUserName")
// .password("newPassword");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void onConnected(MqttConnectedEvent event) {
public void onDisconnect(MqttDisconnectEvent event) {
logger.info("MqttDisconnectEvent:{}", event);
// 在断线时更新 clientId、username、password,只能改这 3 个,不可调用其他方法。
mqttClientCreator.clientId("newClient" + System.currentTimeMillis())
.username("newUserName")
.password("newPassword");
// mqttClientCreator.clientId("newClient" + System.currentTimeMillis())
// .username("newUserName")
// .password("newPassword");
}

}

0 comments on commit 0dad8a0

Please sign in to comment.