From 248fb2ce217532b769f588fe8d8d80d8ebbf34f6 Mon Sep 17 00:00:00 2001 From: Craig Hesling Date: Tue, 12 Jun 2018 18:38:21 -0400 Subject: [PATCH] Fixed MQTT ClientID for compatibility with Mosquitto + Auth Plugin --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 9d4c271..d5a3023 100644 --- a/client.go +++ b/client.go @@ -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).