thomasnordquist / MQTT-Explorer

An all-round MQTT client that provides a structured topic overview
https://mqtt-explorer.com
Other
2.99k stars 287 forks source link

Empty payload message won't be displayed #696

Open samuelyhsu opened 1 year ago

samuelyhsu commented 1 year ago

version: 0.4.0-beta1

Thank you very much for your contribution, this tool works very well, only recently I found that empty payload message won't be displayed, sincerely hope that this problem can be solved

josorv commented 1 year ago

Why would you send a message with empty /no payload? As far as i can understand, a message without any payload is a non-existing message. If you have a message with retain flag set, the described method to delete this message from the broker, is to resend the message with an empty payload (empty string)

samuelyhsu commented 1 year ago

Thanks for the reply, when using protobuf, if the field has zero value, the serialized data will be empty. Also, MQTT supports empty messages

tigercl commented 1 year ago

Hi @samuelyhsu

We have noticed that this project does not appear to be actively maintained anymore.

So I would like to invite you to try the open source MQTT client MQTTX (https://mqttx.app/). I think it can meet your needs of displaying empty messages, and MQTT X provides full support for MQTT 5.0.

If you encounter any problems while using MQTTX, you can get support at https://github.com/emqx/MQTTX/issues.

😄

DavidHopkinsFbr commented 1 year ago

Why would you send a message with empty /no payload? As far as i can understand, a message without any payload is a non-existing message. If you have a message with retain flag set, the described method to delete this message from the broker, is to resend the message with an empty payload (empty string)

A message with no payload is still delivered to clients which are subscribed to the topic, which fires the "message received" handlers on the client side. The client knows the topic name for the empty message it just received. This is ideal for signalling that a specific event has just occurred (as long as you don't need to worry about buffering events for disconnected clients). Note that in this scenario you would likely not use the retained flag. Empty payload messages are also handy for erasing retained data, as you've mentioned.