Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] question from IRC

When a client publishes a message and the client app, network connection or server drop while the message is being delivered the client holds onto the message. It will deliver the message when connectivity is re-established as long as, the client connected with cleansession set to false and the message was published at a quality of service greater than zero.  One method to track the delivery status of a message is to use a delivery token. As the delivery may complete across restarts of the client or connection the delivery token has a life across client and connection instances.

In the case where connectionLost is driven and then the connection is re-stablished the original deliveyToken for messages still to be delivered can be used to track the delivery of the message,

In the case where the MQTT client instance is closed (maybe the process is terminated) and the MQTT client is reinstantiated the set of delivery tokens for messages that were previously published but delivery had not completed can be obtained by using the  getPendingDeliveryTokens() method prior to connecting,  


All the best
Dave

 



From:        Andy Piper <andypiperuk@xxxxxxxxx>
To:        General development discussions for paho project <paho-dev@xxxxxxxxxxx>
Date:        04/06/2013 23:40
Subject:        [paho-dev] question from IRC
Sent by:        paho-dev-bounces@xxxxxxxxxxx




From #mqtt on freenode, something I was asked but missed responding to
last week:

16:56:01] <g00s> andypiper if you are around, the paho java docs say
about IMqttDeliveryToken "Unlike instances of IMqttToken delivery
tokens can be used across connection and client restarts." … can you
explain this? i dont follow

Dave - any comments? Sounds like something that could be clarified. NB
we also need to update the online Javadoc asap.


--
Andy Piper | Farnborough, Hampshire (UK)
blog:
http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images:
http://www.flickr.com/photos/andypiper
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
http://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