diff --git a/config/config.go b/config/config.go index 944c8bb2..d26db1e9 100644 --- a/config/config.go +++ b/config/config.go @@ -36,7 +36,7 @@ type ServerConfig struct { APIConnString string `yaml:"apiconn"` APIHost string `yaml:"apihost"` APIPort string `yaml:"apiport"` - BrokerEndpoint string `yaml:"brokerendpoint"` + Broker string `yam:"broker"` ServerBrokerEndpoint string `yaml:"serverbrokerendpoint"` BrokerType string `yaml:"brokertype"` EmqxRestEndpoint string `yaml:"emqxrestendpoint"` @@ -66,7 +66,6 @@ type ServerConfig struct { Telemetry string `yaml:"telemetry"` HostNetwork string `yaml:"hostnetwork"` Server string `yaml:"server"` - Broker string `yam:"broker"` PublicIPService string `yaml:"publicipservice"` MQPassword string `yaml:"mqpassword"` MQUserName string `yaml:"mqusername"` diff --git a/servercfg/serverconf.go b/servercfg/serverconf.go index fb9503b1..1bcd5081 100644 --- a/servercfg/serverconf.go +++ b/servercfg/serverconf.go @@ -230,7 +230,7 @@ func GetPublicBrokerEndpoint() string { if os.Getenv("BROKER_ENDPOINT") != "" { return os.Getenv("BROKER_ENDPOINT") } else { - return config.Config.Server.BrokerEndpoint + return config.Config.Server.Broker } } @@ -243,8 +243,8 @@ func GetMessageQueueEndpoint() (string, bool) { host = config.Config.Server.ServerBrokerEndpoint } else if os.Getenv("BROKER_ENDPOINT") != "" { host = os.Getenv("BROKER_ENDPOINT") - } else if config.Config.Server.BrokerEndpoint != "" { - host = config.Config.Server.BrokerEndpoint + } else if config.Config.Server.Broker != "" { + host = config.Config.Server.Broker } else { host += ":1883" // default }