mirror of https://github.com/minio/minio.git
fix: clientId must be unique for all servers (#14398)
This is a regression from #14037, distributed setups with MQTT was not working anymore. According to MQTT spec it is expected this is unique per server. We shall proceed to use unix nano timestamp hex value instead here.
This commit is contained in:
parent
2d78e20120
commit
1bfbe354f5
|
@ -213,8 +213,13 @@ func NewMQTTTarget(id string, args MQTTArgs, doneCh <-chan struct{}, loggerOnce
|
|||
args.KeepAlive = 10 * time.Second
|
||||
}
|
||||
|
||||
// Using hex here, to make sure we avoid 23
|
||||
// character limit on client_id according to
|
||||
// MQTT spec.
|
||||
clientID := fmt.Sprintf("%x", time.Now().UnixNano())
|
||||
|
||||
options := mqtt.NewClientOptions().
|
||||
SetClientID(id).
|
||||
SetClientID(clientID).
|
||||
SetCleanSession(true).
|
||||
SetUsername(args.User).
|
||||
SetPassword(args.Password).
|
||||
|
|
Loading…
Reference in New Issue