Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Java client and disconnected publishing with file persistence issues

Hi Mark,
 
Thanks for finding these bugs, I've created an Issue on GitHub here (https://github.com/eclipse/paho.mqtt.java/issues/224)  outlining them and will see if I can get a fix into the next SNAPSHOT build.
 
Kind regards,
 
James Sutton
Software Engineer - IoT Foundation - MQTT Open Source Projects
Ops Team - Wimbledon Project

Phone: 01962 815438 | Extension: x372454
E-mail: 
Personal Website: www.jsutton.co.uk
Find me on:      
IBM

Hursley Park
HursleySO212JN
United Kingdom
 
IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU
 
 
----- Original message -----
From: Mark Anstice <mark.anstice@xxxxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: "paho-dev@xxxxxxxxxxx" <paho-dev@xxxxxxxxxxx>
Cc:
Subject: [paho-dev] Java client and disconnected publishing with file persistence issues
Date: Thu, Jul 28, 2016 1:49 PM
 

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.

 

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
 
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