Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] [Paho MQTT Golang] Device only send 120 messages in store (QoS 2)

Hi Vio,
In the case that a connection is lost but the program continues to run and autoreconnects the messages that are queued to be sent are stored in the internal buffers of the client, and when the connection is reestablished it is from there that the messages to be sent are taken, not the persistence store. There has been a recent PR merged that supports resuming sending messages from the persistence store then the whole client is stopped and recreated, this may resolve your issue, it's currently in HEAD on the github repo, I plan a 1.2.0 release shortly.
Allan Stockdill-Mander, GCFA
Tech Lead Firewalls and Automation - Alchemy
----- Original message -----
From: aditya alviori <adityaalviori@xxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: paho-dev@xxxxxxxxxxx
Subject: [paho-dev] [Paho MQTT Golang] Device only send 120 messages in store (QoS 2)
Date: Thu, Oct 18, 2018 5:22 AM
Dear Paho-Dev Team,
Let me introduce myself, I am Vio, from Indonesia.
I use Paho-MQTT golang to send data every 5 seconds to broker using QoS 2. The broker was installed in server with standard installation (no additional setting, except username and password).
When I lost connection, messages store in "mqttStore folder" which I created in internal memory. When I get connection, only 120 messages show in my subscriber. In folder, I still found the rest of messages. 
I want to ask about:
1. The rest of messages in store caused by mqtt in device or in the broker?
2. Are there additional setting in client to start MQTT in device?
my setting:
opts = mqtt.NewClientOptions()
opts.AddBroker("tcp://" + IPADDRESS + ":" + PORT).SetClientID("PT.IP_test/" + LOCOID)
opts.SetMaxReconnectInterval(30 * time.Second).SetAutoReconnect(true).SetMessageChannelDepth(150)
Thanks for your help
Best Regards,
Aditya Alviori
paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Back to the top