add : in server connection string

This commit is contained in:
Matthew R. Kasun
2022-05-25 11:37:55 -04:00
parent 53b3e7f415
commit 0764632b30
2 changed files with 2 additions and 3 deletions

View File

@@ -210,7 +210,7 @@ func NewTLSConfig(server string) *tls.Config {
func setupMQTT(cfg *config.ClientConfig, publish bool) (mqtt.Client, error) { func setupMQTT(cfg *config.ClientConfig, publish bool) (mqtt.Client, error) {
opts := mqtt.NewClientOptions() opts := mqtt.NewClientOptions()
server := cfg.Server.Server server := cfg.Server.Server
opts.AddBroker("ssl://" + server + servercfg.GetMQPort()) opts.AddBroker("ssl://" + server + ":" + servercfg.GetMQPort())
opts.SetTLSConfig(NewTLSConfig(server)) opts.SetTLSConfig(NewTLSConfig(server))
opts.SetClientID(ncutils.MakeRandomString(23)) opts.SetClientID(ncutils.MakeRandomString(23))
opts.SetDefaultPublishHandler(All) opts.SetDefaultPublishHandler(All)

View File

@@ -224,8 +224,7 @@ func GetMessageQueueEndpoint() string {
} else if config.Config.Server.MQHOST != "" { } else if config.Config.Server.MQHOST != "" {
host = config.Config.Server.MQHOST host = config.Config.Server.MQHOST
} }
//Do we want MQ port configurable??? return host + ":" + GetMQServerPort()
return host + GetMQServerPort()
} }
// GetMasterKey - gets the configured master key of server // GetMasterKey - gets the configured master key of server