I used Paho MQTT for Golang with QoS 2 to publish data. When my device disconnect, data stored in a directory. After reconnect, my device publish data to broker, but only 120-first of data publish to broker. I checked in the storage directory, there are some data left in that directory.
my MQTT setting options
opts = mqtt.NewClientOptions()
opts.AddBroker("tcp://" + c.ServerHost + ":" + c.ServerPort).SetClientID("myclientid/" + c.LocoID).SetMaxReconnectInterval(1 * time.Minute).SetAutoReconnect(true).SetMessageChannelDepth(150)
opts.SetUsername("myusername").SetPassword("mypass")
opts.SetCleanSession(false).SetStore(mqtt.NewFileStore("/home/locotrack/locotrack/storeMQTT"))
Did i miss the configuration setting on that client options?
Thanks for your help