Skip to content

Commit

Permalink
set random id
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Apr 16, 2024
1 parent 35ddb97 commit 5ff9289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mq/mq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
Expand Down

0 comments on commit 5ff9289

Please sign in to comment.