@@ -69,7 +69,7 @@ func (p *MQTTPublisher) dataInbox() chan<- AgentResponse {
6969func (p * MQTTPublisher ) start () {
7070 logger .Println ("MQTTPublisher.start()" )
7171
72- if p .config .Discover && p .config .ServerUri == "" {
72+ if p .config .Discover && p .config .URL == "" {
7373 err := p .discoverBrokerEndpoint ()
7474 if err != nil {
7575 logger .Println ("MQTTPublisher.start() failed to start publisher:" , err .Error ())
@@ -81,7 +81,7 @@ func (p *MQTTPublisher) start() {
8181 p .configureMqttConnection ()
8282
8383 // start the connection routine
84- logger .Printf ("MQTTPublisher.start() Will connect to the broker %v\n " , p .config .ServerUri )
84+ logger .Printf ("MQTTPublisher.start() Will connect to the broker %v\n " , p .config .URL )
8585 go p .connect (0 )
8686
8787 qos := 1
@@ -128,7 +128,7 @@ func (p *MQTTPublisher) discoverBrokerEndpoint() error {
128128 }
129129 logger .Println (proto .Endpoint ["url" ])
130130 if ProtocolType (proto .Type ) == ProtocolTypeMQTT {
131- p .config .ServerUri = proto .Endpoint ["url" ].(string )
131+ p .config .URL = proto .Endpoint ["url" ].(string )
132132 break
133133 }
134134 }
@@ -154,7 +154,7 @@ func (p *MQTTPublisher) connect(backOff int) {
154154 return
155155 }
156156 for {
157- logger .Printf ("MQTTPublisher.connect() connecting to the broker %v, backOff: %v sec\n " , p .config .ServerUri , backOff )
157+ logger .Printf ("MQTTPublisher.connect() connecting to the broker %v, backOff: %v sec\n " , p .config .URL , backOff )
158158 time .Sleep (time .Duration (backOff ) * time .Second )
159159 if p .client .IsConnected () {
160160 break
@@ -171,7 +171,7 @@ func (p *MQTTPublisher) connect(backOff int) {
171171 }
172172 }
173173
174- logger .Printf ("MQTTPublisher.connect() connected to the broker %v" , p .config .ServerUri )
174+ logger .Printf ("MQTTPublisher.connect() connected to the broker %v" , p .config .URL )
175175 return
176176}
177177
@@ -185,7 +185,7 @@ func (p *MQTTPublisher) onConnectionLost(client *MQTT.MqttClient, reason error)
185185
186186func (p * MQTTPublisher ) configureMqttConnection () {
187187 connOpts := MQTT .NewClientOptions ().
188- AddBroker (p .config .ServerUri ).
188+ AddBroker (p .config .URL ).
189189 SetClientId (p .clientId ).
190190 SetCleanSession (true ).
191191 SetOnConnectionLost (p .onConnectionLost )
@@ -197,7 +197,7 @@ func (p *MQTTPublisher) configureMqttConnection() {
197197 }
198198
199199 // SSL/TLS
200- if strings .HasPrefix (p .config .ServerUri , "ssl" ) {
200+ if strings .HasPrefix (p .config .URL , "ssl" ) {
201201 tlsConfig := & tls.Config {}
202202 // Custom CA to auth broker with a self-signed certificate
203203 if p .config .CaFile != "" {
0 commit comments