Does Eclipse Paho Mqtt Client persist all the published messages published till they are ACKed for delivery by the broker under QoS-2?

南楼画角 提交于 2019-12-07 17:38:51

问题


Does the default PAHO MQTT implementation persist all the messages that are being pushed, until their delivery is confirmed specifically in QoS 2 ? Or if not how is it possible to implement such by our own?

UPDATE Since paho android service version 1.1.0 automatic reconnect and offline buffering features are implemented. For more info : https://www.eclipse.org/paho/clients/android/


回答1:


From the javadoc for MqttClient

By default MqttDefaultFilePersistence is used to store messages to a file. If persistence is set to null then messages are stored in memory and hence can be lost if the client, Java runtime or device shuts down.

This means as long as you set the path correctly and have the right Android permissions to write to local storage, QOS2 messages should be persisted until delivered to the broker (not the end subscribers).




回答2:


UPDATE

Since paho android service version 1.1.0 automatic reconnect and offline buffering are implemented. Please refer to : https://www.eclipse.org/paho/clients/android/.



来源:https://stackoverflow.com/questions/31826206/does-eclipse-paho-mqtt-client-persist-all-the-published-messages-published-till

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!