MQTT: Not receiving offline messsages

Internet of Things IoT Frameworks 2 years ago

0 0 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ My client connects with the following parameters: Clean Session: False Client ID: Fixed (same every time) Subscribed with QoS=1 Message Published with QoS=1 I am trying to verify that if the broker receives messages when the client is offline, the messages are queued on the broker and sent to client when it comes online again. However, I find that the broker does not send anything to the client on reconnect. This is how I tested: Connect client to broker using the four parameters mentioned above. Subscribe to topics of interest with QoS=1 Disconnect client Using another client program and another client id, connect to the broker Publish message to the same topic that was subscribed to by the now offline client. Wait for a few seconds, now reconnect the offline client with the same connection settings as before. Expected Result: As soon as connection is re-established the client will receive messages that were sent to its topic while it was offline. Actual Result: Client gets no messages. It is able to receive any new messages that are sent AFTER it is connected, but no offline messages.** I have verified using Wireshark that the SUBSCRIBE and message PUBLISH packets sent to the server have QoS=1 and clean session flag is false in CONNECT packet. Broker: Mosquitto v1.4.11 MQTT Config File: pid_file /var/run/mosquitto.pid persistence true persistence_location /var/lib/mosquitto/ log_dest file /var/log/mosquitto/mosquitto.log log_type debug listener 9001 protocol websockets listener 1883 protocol mqtt allow_anonymous false acl_file /path/to/acl_file password_file /path/to/password_file

Posted on 16 Aug 2022, this text provides information on IoT Frameworks related to Internet of Things. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (0)

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Internet of Things Links