Merge pull request #4 from linux4life798/master

Fixed MQTT ClientID formatting for Mosquitto with Auth Plugin compatibility
This commit is contained in:
Alexandr Krylovskiy
2018-06-17 14:34:06 +02:00
committed by GitHub

View File

@@ -118,7 +118,7 @@ func (c *Client) pubMessages(in, out chan *Message, doneGen, donePub chan bool)
opts := mqtt.NewClientOptions().
AddBroker(c.BrokerURL).
SetClientID(fmt.Sprintf("mqtt-benchmark-%v-%v", time.Now(), c.ID)).
SetClientID(fmt.Sprintf("mqtt-benchmark-%v-%v", time.Now().Format(time.RFC3339Nano), c.ID)).
SetCleanSession(true).
SetAutoReconnect(true).
SetOnConnectHandler(onConnected).