Hello,
I am using mosquitto C library. I am writing client which is sometimes online, sometimes offline, sometimes client is restarted. I want to implement mechanism to guaranty that all data collected by client from sensor are sent to broker and I have non-violated memory for that.
As I noticed that mosquitto library saves messages which have not been sent to broker and they are resent automatically when connection is restored. But there are two main problems I can see with that buffer:
1. I can not work with unsent messages mosquitto buffer: I can't find our how many unsent messaged are currently queued, I can't check if certain message is in this buffer, I can't purge that mosquitto buffer. I can't set maximum buffer size.
2. This mosquitto messages buffer is resetted if I reload application.
I can keep all samples in non-violated memory, but how can I check if certain message will be resent by mosquitto library automatically or I have to resend it manually, because this message is already not in mosquitto buffer after client restart? Is any way to control mosquitto buffer (see number 1) ?