mirror of
https://github.com/wwhai/mqtt-benchmark.git
synced 2025-10-04 23:32:46 +08:00
Fixed MQTT ClientID for compatibility with Mosquitto + Auth Plugin
This commit is contained in:
@@ -118,7 +118,7 @@ func (c *Client) pubMessages(in, out chan *Message, doneGen, donePub chan bool)
|
|||||||
|
|
||||||
opts := mqtt.NewClientOptions().
|
opts := mqtt.NewClientOptions().
|
||||||
AddBroker(c.BrokerURL).
|
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).
|
SetCleanSession(true).
|
||||||
SetAutoReconnect(true).
|
SetAutoReconnect(true).
|
||||||
SetOnConnectHandler(onConnected).
|
SetOnConnectHandler(onConnected).
|
||||||
|
Reference in New Issue
Block a user