How to remove a published topic

Sirapat picture Sirapat · Feb 14, 2017 · Viewed 7.2k times · Source

I am new to MQTT protocol. As I read through the document, I couldn't see any function to remove the published topic. My purpose is to allow the publisher to remove the published topic. Did I miss something in the mqtt document? Any suggestion? Thanks !

Answer

JeffL picture JeffL · Dec 1, 2018

Well, if you mean remove a topic from mosquitto so that is doesn't show when you sub #, you can use:

mosquitto_pub -h <hostname>  -p <port> -u <user> -P <password> -t '<topic you want to remove>' -n -r