使用Mosquitto_sub命令时如何查看消息MQTT属性

发布于 2025-02-06 01:02:44 字数 149 浏览 2 评论 0原文

我正在运行Mosquitto命令Mosquitto_sub订阅一个主题,并查看那里发布的消息。

我希望能够看到有人在该主题中发布消息时使用的 mqtt属性

有什么办法吗?

谢谢

I'm running Mosquitto command mosquitto_sub to subscribe to a topic and see the messages published there.

I would like to be able to see the MQTT properties used when someone publishes a message in that topic.

Is there any way?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

方圜几里 2025-02-13 01:02:44

您可以使用采用模式的格式选项(-f),例如:

mosquitto_sub -t <topic> -V mqttv5 -F %C

在上面的示例中,我们正在打印内容类型属性(%c)。

不要忘记使用MQTTV5的版本选项(-v)。

您可以在此处找到更多可打印的属性: https:/ 1.html#outputformat (请参阅MQTT相关参数)

You can use the format option (-F) that takes a pattern, for example:

mosquitto_sub -t <topic> -V mqttv5 -F %C

In the example above we are printing the Content type property (%C).

Don't forget the version option (-V) using mqttv5.

You can find more printable properties here: https://mosquitto.org/man/mosquitto_sub-1.html#outputformat (see MQTT related parameters)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文