This commit is contained in:
2025-07-10 10:53:01 +08:00
parent dc63f19a6f
commit 2cefad0327
4 changed files with 312 additions and 132 deletions

View File

@@ -40,7 +40,7 @@ namespace ZR.Common.MqttHelper
var builder = new MqttClientOptionsBuilder()
.WithClientId(mqttConfig["ClientId"] ?? Guid.NewGuid().ToString())
.WithTcpServer(mqttConfig["Server"], mqttConfig.GetValue<int>("Port", 1883))
.WithCleanSession();
.WithCleanSession(false);
return builder.Build();
}