使用Mosquitto_sub命令时如何查看消息MQTT属性
我正在运行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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用采用模式的格式选项(
-f
),例如:在上面的示例中,我们正在打印内容类型属性(
%c
)。不要忘记使用
MQTTV5
的版本选项(-v
)。您可以在此处找到更多可打印的属性: https:/ 1.html#outputformat (请参阅MQTT相关参数)
You can use the format option (
-F
) that takes a pattern, for example:In the example above we are printing the Content type property (
%C
).Don't forget the version option (
-V
) usingmqttv5
.You can find more printable properties here: https://mosquitto.org/man/mosquitto_sub-1.html#outputformat (see MQTT related parameters)