Dear support team!
I have a problem with getting messages that were published (with QoS 1) while device was not connected. Here are the prerequisites and the cases:
Prerequisites:
- device is subscribed for topic “#” with QoS 1
- device is connected with Clear Session = false
- device interacts with the broker via REST API
- messages are published with QoS 1
Use case 1:
- the script receives subscriptions for devices, result is: [["#",1,true]] (as expected)
- in the script I have looped the part where the messages are pulled in order to have time to publish the message
- during this loop execution I have published the messages via Web interface
- as a result of execution I receive the following JSON: [{“dup”:false,“payload”:“dGVzdCAy”,“retain”:false,“tokenId”:"{myTokenId}",“topic”:“test_topic”,“qos”:1}]
- messages pulling works as expected
Use case 2:
- I run the same script, however, I publish message BEFORE I start it.
- Script gets available subscriptions: [["#",1,true]] (as expected)
- result of pulling the messages is: [] (NOT as expected).
Expected result - to receive JSON with the message published before execution of the script.
Is my understanding correct that for QoS 1 messages should be available in case they are published while device is not connected? This is what I got from the topic Publish message via RestAPI
Please let me know how it should work.
Thank you.
Kind regards,
Andrey