moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 513 forks source link

Feature request: remove retained messages #795

Open mschwartz opened 5 years ago

mschwartz commented 5 years ago

I would like to remove several retained messages, and ideally the mqtt command line tool could be enhanced to do it.

Something like: mqtt remove -t topic_pattern

subscribes to topic_pattern and for each topic/message received, publish( topic, null).

An extra feature would be to have a -f regex to filter topics using a regex. Then I can:

mqtt remove -t '#' -f "^substr.*$"

The filter argument would make this very powerful and most flexible.

I typically use the command line mqtt program to show some topic (pattern) live stream. The retained topics I want to remove make a lot of noise in the display.