|
@@ -57,7 +57,7 @@ func initMqttClient(conf *MqttConfig) (mc MQTT.Client, err error) {
|
|
|
}
|
|
|
opts.SetClientID(fmt.Sprintf("%s_%s", conf.ClientId, guid.S())).
|
|
|
SetUsername(conf.User).SetPassword(conf.Password).
|
|
|
- SetConnectRetry(true)
|
|
|
+ SetConnectRetry(true).SetCleanSession(true)
|
|
|
opts.SetConnectionAttemptHandler(func(broker *url.URL, tlsCfg *tls.Config) *tls.Config {
|
|
|
server.Log.Infof("connect to %s", broker.String())
|
|
|
return tlsCfg
|