mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-14 17:14:45 +08:00
set random id
This commit is contained in:
parent
35ddb97b98
commit
5ff9289462
1 changed files with 2 additions and 1 deletions
3
mq/mq.go
3
mq/mq.go
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||
"github.com/gravitl/netmaker/logger"
|
||||
"github.com/gravitl/netmaker/logic"
|
||||
"github.com/gravitl/netmaker/servercfg"
|
||||
"golang.org/x/exp/slog"
|
||||
)
|
||||
|
@ -27,7 +28,7 @@ var mqclient mqtt.Client
|
|||
func setMqOptions(user, password string, opts *mqtt.ClientOptions) {
|
||||
broker, _ := servercfg.GetMessageQueueEndpoint()
|
||||
opts.AddBroker(broker)
|
||||
opts.ClientID = user
|
||||
opts.ClientID = logic.RandomString(23)
|
||||
opts.SetUsername(user)
|
||||
opts.SetPassword(password)
|
||||
opts.SetAutoReconnect(true)
|
||||
|
|
Loading…
Add table
Reference in a new issue