If the clear session flag is set to FALSE, I skip the published values

Does anyone have a logical explanation why, despite what I have clear session flage = false, I do not receive an updated published message that I subscribed to while I’m not connected to a broker?

With the false flag set, I started my application, and I continued to publish some values ​​in the topic (from PC to broker, and not from Android device to broker). And then I disconnected the Android USB device from the PC and continued to publish some values ​​again. When I reconnected the USB to the computer, I expected to see the values ​​that I recently posted in this thread, but I did not receive them.

The topic that I am publishing is precisely the topics that I subscribed to, p QoS = 1.

0
source share
2 answers

For messages to be queued for a client who is no longer connected to a broker, these things must be true:

  • The client should initially connect with clean sessionfalse
  • Customer must subscribe to QoS> 0
  • Posts on this topic should be published with QoS> 0.
  • When a client reconnects, it should have the same client idas when disconnecting
  • When a client reconnects, it must be clean sessionfalse

My bet is that you fail at any of the last two points.

+7
source
0

Source: https://habr.com/ru/post/1650005/


All Articles