Not able to retrieve the persisted messages #578
Comments
This? #215 (comment). MongoDB persistence has a 1h TTL: https://github.com/mcollina/mosca/blob/master/lib/persistence/mongo.js#L35-L46. Note the |
#215 (comment), |
try changing the TTL. |
Still facing the inconsistency. |
Can you please provide detailed instructions to reproduce, including source code examples, client (possibly MQTT.js) and so on? |
Mosca-Server.js
Normal Publisher: Subscriber using Paho-MQTT:
I start the subscriber, publish a message which is received at the subscriber then purposely bring the subscriber down. Publish an offline message with QoS=1 and start the subscriber again sometimes able to retrieve the message sometimes not. Tried changing the clientID and then re-subscribe facing the same issue. |
A couple of note in your code: a. your publisher issue a PUBLISH on topic |
Thanks, for pointing out the issues. The main cause was that I was stopping the client session completely (Disconnect). If the network disconnect happens and the client session is retained I`m able to get the messages but not in the case of the client session closure. This is the default working mechanism of MQTT Protocol with QoS=1, figured it out a bit late :-) |
Mosca setup with MongoDB persistence as per this PR:
#215
Even facing consistency issue with MQTTfx but works fine in case of mosquitto client.
mosquitto_sub -d -c -i sample -q 1 -t test/offline
Need to debug the cause of this inconsistency.
Using the below sample paho-mqtt Python code for subscribing:
The text was updated successfully, but these errors were encountered: