Hi all,
I have been experimenting the Java client and in particular the disconnected publishing feature with file-based persistence and have come across a couple of issues (may be user error or I have misunderstood something):
1.
I notice the DisconnectedBufferOptions.isPersistBuffer() method isn’t used – presumably the persistence scheme specified or defaulted by the MqttAsyncClient constructors is used?
2.
Publishing messages when the client is in a disconnected state and using file based persistence I can see sb-0.msg is created on disk, however this file is overwritten for every message because the MqttWireMessage’s messageId field
is not updated, this is used in the ClientState. getSendBufferedPersistenceKey method to construct the filename.
3.
The ClientState. unPersistBufferedMessage method is only called during a reconnect, first time connections will not read buffered messages from the disk persistence store and are leaked (well, 1 is leaked because I only have a maximum
of 1 message due to #2.). Note if I cause the client to disconnect then on re-connection in the ClientComms.notifyReconnect method the message is still not unpersisted in (i.e. deleted from disk) because there isn’t a matching messageId with index 0 in the
DisconnectedMessageBuffer array.
Any help or guidance much appreciated, am happy to provide mode detail for #2 and #3 if needed.
Cheers,
Mark.