Unsubscribing from topics

Whenever we don't want a subscriber to receive more messages whose destination topic name matches one or more topic filters, the subscriber can send a request to unsubscribe to a list of topic filters to the MQTT server. Obviously, unsubscribing from topic filters is the opposite operation of subscribing to topic filters. We will use the MQTT.fx GUI utility to unsubscribe the MQTT client from the sensors/drone01/altitude topic. Follow the next steps:

  1. Go to the MQTT.fx window in which you established a connection and subscribed to a topic.
  2. Click Subscribe.
  3. Click on the panel that displays the sensors/drone01/altitudetopic name at the left-hand side of the window. Then, click on the Unsubscribe button located in this panel. ...

Get MQTT Essentials - A Lightweight IoT Protocol now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.