I received the last message on MQTTkit ios

290 views Asked by At

When I connected me to MQTT server with the MQTTKit for IOS (https://github.com/jmesnil/MQTTKit), I received the last message published but I don't want it

How can I do ?

1

There are 1 answers

0
hardillb On BEST ANSWER

That message was published with the Retained bit set to true.

This flag tells the broker to deliver the last message on a give topic with this bit set to be sent to any client that subscribes to that topic.

You can clear the message by sending an empty (null) message to the same topic with the retained bit set.

HiveMQ have a article which explains in more details: http://www.hivemq.com/mqtt-essentials-part-8-retained-messages/