[{"data":1,"prerenderedAt":1412},["Reactive",2],{"VEb9Nnn1YX":3,"blog-post-zh-how-to-publish-and-receive-protobuf-messages-within-mqtt":26,"blog-posts-zh":1190},{"items":4,"meta":23},[5,8,11,14,17,20],{"title":6,"titleUrl":7},"如何在 Python3 中使用 MQTT 客户端库 Paho Client","how-to-use-mqtt-in-python",{"title":9,"titleUrl":10},"MQTT服务器（MQTT Broker）：工作原理与快速入门指南","the-ultimate-guide-to-mqtt-broker-comparison",{"title":12,"titleUrl":13},"MQTT QoS 0、1、2 解析：快速入门指南","introduction-to-mqtt-qos",{"title":15,"titleUrl":16},"在 ESP32 上使用 MQTT：入门指南","esp32-connects-to-the-free-public-mqtt-broker",{"title":18,"titleUrl":19},"MQTT 主题与通配符（Topics & Wildcards）入门手册","advanced-features-of-mqtt-topics",{"title":21,"titleUrl":22},"车联网 CAN Bus 协议介绍与数据实时流处理","can-bus-how-it-works-pros-and-cons",{"count":24,"limit":24,"page":25},6,1,{"slug":27,"title":28,"description":29,"date":30,"category":31,"cover":32,"version":-1,"coverWidth":-1,"coverHeight":-1,"updated":-1,"tags":33,"readingTime":36,"doc":37},"how-to-publish-and-receive-protobuf-messages-within-mqtt","如何在 MQTT 中发布和接收 Protobuf 消息？","MQTTX 是一款开源的全功能 MQTT 客户端，支持从 JSON、Base64 到现如今的 Protobuf 的多种格式。我们将在本文中展示如何使用 MQTTX 来定义、发布和接收 Protobuf 消息。","2024-04-17","guides","https://assets.emqx.com/images/348e290abdede74446c634642b1bfcf7.png",[34,35],"Protobuf","MQTT",7,{"_path":38,"_dir":39,"_draft":40,"_partial":40,"_locale":41,"title":28,"description":29,"date":42,"category":31,"tags":43,"cover":32,"body":44,"_type":1183,"_id":1184,"_source":1185,"_file":1186,"_extension":1187,"readingTime":36,"sitemap":1188},"/blog/zh/how-to-publish-and-receive-protobuf-messages-within-mqtt","zh",false,"","2024-04-17T00:00:00.000Z",[34,35],{"type":45,"children":46,"toc":1167},"root",[47,56,73,95,100,114,121,135,172,178,191,197,202,502,507,513,518,526,531,533,587,707,727,733,738,743,748,986,991,996,1152,1157,1162],{"type":48,"tag":49,"props":50,"children":52},"element","h2",{"id":51},"mqtt-与-protobuf",[53],{"type":54,"value":55},"text","MQTT 与 Protobuf",{"type":48,"tag":57,"props":58,"children":59},"p",{},[60,62,71],{"type":54,"value":61},"在日益复杂的数据交换环境中，选择正确的数据序列化格式显得至关重要。Protobuf 因其高效的序列化特性，已被广泛应用于大型互联网公司和各类微服务项目中。与此同时，",{"type":48,"tag":63,"props":64,"children":69},"a",{"href":65,"rel":66,"target":68},"https://www.emqx.com/zh/blog/the-easiest-guide-to-getting-started-with-mqtt",[67,67],"noopener","_blank",[70],{"type":54,"value":35},{"type":54,"value":72}," 作为一个轻量级基于发布订阅模式的消息传输协议，与 Protobuf 的结合显然可以进一步优化物联网数据交换体验。",{"type":48,"tag":57,"props":74,"children":75},{},[76,78,84,86,93],{"type":54,"value":77},"如何确保和测试 Protobuf 消息在 MQTT 中正确发布和接收是一个关键问题。",{"type":48,"tag":63,"props":79,"children":81},{"href":80},"/zh",[82],{"type":54,"value":83},"MQTTX",{"type":54,"value":85}," —— 一款开源的全功能 ",{"type":48,"tag":63,"props":87,"children":90},{"href":88,"rel":89,"target":68},"https://www.emqx.com/zh/blog/mqtt-client-tools",[67,67],[91],{"type":54,"value":92},"MQTT 客户端",{"type":54,"value":94},"，支持从 JSON、Base64 到现如今的 Protobuf 的多种格式。在这篇文章中，我们将展示如何使用 MQTTX 来定义、发布和接收 Protobuf 消息。",{"type":48,"tag":49,"props":96,"children":98},{"id":97},"准备工作",[99],{"type":54,"value":97},{"type":48,"tag":57,"props":101,"children":102},{},[103,105,112],{"type":54,"value":104},"为确保顺利地与物联网设备交流，我们需要安装一个 EMQX ",{"type":48,"tag":63,"props":106,"children":109},{"href":107,"rel":108,"target":68},"https://www.emqx.com/zh/blog/the-ultimate-guide-to-mqtt-broker-comparison",[67,67],[110],{"type":54,"value":111},"MQTT Broker",{"type":54,"value":113}," 和 MQTTX 客户端。EMQX 可以为物联网设备提供消息传输功能，MQTTX 则允许我们进行消息的发布和订阅。",{"type":48,"tag":115,"props":116,"children":118},"h3",{"id":117},"安装-emqx",[119],{"type":54,"value":120},"安装 EMQX",{"type":48,"tag":57,"props":122,"children":123},{},[124,126,133],{"type":54,"value":125},"EMQX 是一个高性能、可扩展的 MQTT 平台，适用于物联网、",{"type":48,"tag":63,"props":127,"children":130},{"href":128,"rel":129,"target":68},"https://www.emqx.com/zh/blog/iiot-explained-examples-technologies-benefits-and-challenges",[67,67],[131],{"type":54,"value":132},"工业物联网",{"type":54,"value":134},"和车载网络场景。我们选择了 5.5.1 版本的 EMQX 企业版，因为其规则引擎能够使用 Protobuf 进行编码和解码，便于处理和验证 Protobuf 数据。",{"type":48,"tag":136,"props":137,"children":138},"ul",{},[139,158],{"type":48,"tag":140,"props":141,"children":142},"li",{},[143,145],{"type":54,"value":144},"使用 Docker 安装：",{"type":48,"tag":146,"props":147,"children":152},"pre",{"className":148,"code":150,"language":151,"meta":41},[149],"language-shell","docker run -d --name emqx-enterprise -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx-enterprise:5.5.1\n","shell",[153],{"type":48,"tag":154,"props":155,"children":156},"code",{"__ignoreMap":41},[157],{"type":54,"value":150},{"type":48,"tag":140,"props":159,"children":160},{},[161,163,170],{"type":54,"value":162},"对于非 Docker 用户，EMQX 提供 RPM 或 DEB 包。",{"type":48,"tag":63,"props":164,"children":167},{"href":165,"rel":166,"target":68},"https://docs.emqx.com/zh/emqx/v5.5/deploy/install.html",[67,67],[168],{"type":54,"value":169},"EMQX 5.5 安装指南",{"type":54,"value":171},"提供了详细的安装说明。",{"type":48,"tag":115,"props":173,"children":175},{"id":174},"安装-mqttx-客户端",[176],{"type":54,"value":177},"安装 MQTTX 客户端",{"type":48,"tag":57,"props":179,"children":180},{},[181,183,189],{"type":54,"value":182},"MQTTX 提供桌面版和命令行版本，均支持 Protobuf 消息传输。您可以根据需求访问 ",{"type":48,"tag":63,"props":184,"children":186},{"href":185},"/zh/downloads",[187],{"type":54,"value":188},"MQTTX 官网",{"type":54,"value":190}," 下载合适的版本。",{"type":48,"tag":49,"props":192,"children":194},{"id":193},"在-mqttx-桌面端中使用-protobuf-消息",[195],{"type":54,"value":196},"在 MQTTX 桌面端中使用 Protobuf 消息",{"type":48,"tag":57,"props":198,"children":199},{},[200],{"type":54,"value":201},"MQTTX 的桌面客户端为用户带来了更加高效和个性化的体验。在最新版本中，我们对脚本部分进行了优化，特别是新增的自定义函数和编解码脚本功能。这些新特性使得处理和查看 Protobuf 格式的数据更为轻松。",{"type":48,"tag":203,"props":204,"children":205},"ol",{},[206,241,291,349,427],{"type":48,"tag":140,"props":207,"children":208},{},[209,215,219,221,224,232],{"type":48,"tag":210,"props":211,"children":212},"strong",{},[213],{"type":54,"value":214},"进入编解码脚本页面",{"type":48,"tag":216,"props":217,"children":218},"br",{},[],{"type":54,"value":220},"启动 MQTTX 客户端，点击左侧菜单栏中的“脚本”图标，再选择“编解码”选项卡，进入到该页面后有一个简单的默认示例。",{"type":48,"tag":216,"props":222,"children":223},{},[],{"type":48,"tag":225,"props":226,"children":231},"img",{"alt":227,"src":228,"loading":229,"decoding":230},"编解码脚本页面","https://assets.emqx.com/images/98151be6114cc8620508b59f55296325.png?x-image-process=image/resize,w_1520/format,webp","lazy","async",[],{"type":48,"tag":233,"props":234,"children":235},"blockquote",{},[236],{"type":48,"tag":57,"props":237,"children":238},{},[239],{"type":54,"value":240},"**注意：**该示例仅为内容示例，需要保存后才能使用。",{"type":48,"tag":140,"props":242,"children":243},{},[244,249,252,254,257,259,270,273,275,281,283,286],{"type":48,"tag":210,"props":245,"children":246},{},[247],{"type":54,"value":248},"输入或导入 proto 文件",{"type":48,"tag":216,"props":250,"children":251},{},[],{"type":54,"value":253},"您可以在编辑框中输入 proto 格式文件的内容，如下所示，然后点击右上角的“保存”按钮。这样您就成功在 MQTTX 中创建了一个新的 proto 格式的编解码文件。如果您已经有预备好的 proto 文件，可以直接点击右上角的“导入 .proto 文件”按钮进行上传。",{"type":48,"tag":216,"props":255,"children":256},{},[],{"type":54,"value":258},"这里我们简单准备了一个在物联网领域比较常见的 proto 格式的编解码内容：",{"type":48,"tag":146,"props":260,"children":265},{"className":261,"code":263,"language":264,"meta":41},[262],"language-protobuf","syntax = “proto3”;\n\npackage IoT;\n\nmessage SensorData {\n  string deviceId = 1;\n  string sensorType = 2;\n  double value = 3;\n  int64 timestamp = 4;\n}\n","protobuf",[266],{"type":48,"tag":154,"props":267,"children":268},{"__ignoreMap":41},[269],{"type":54,"value":263},{"type":48,"tag":216,"props":271,"children":272},{},[],{"type":54,"value":274},"这个 proto 文件定义了一个 ",{"type":48,"tag":154,"props":276,"children":278},{"className":277},[],[279],{"type":54,"value":280},"SensorData",{"type":54,"value":282}," 消息，其中包括设备ID、传感器类型、传感器值和时间戳。",{"type":48,"tag":216,"props":284,"children":285},{},[],{"type":48,"tag":225,"props":287,"children":290},{"alt":288,"src":289,"loading":229,"decoding":230},"编辑脚本","https://assets.emqx.com/images/f75b52e97682e30955b7802559fb96c7.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":292,"children":293},{},[294,299,302,304,307,312,314,319,321,332,335,337,340,342,345],{"type":48,"tag":210,"props":295,"children":296},{},[297],{"type":54,"value":298},"测试输入输出",{"type":48,"tag":216,"props":300,"children":301},{},[],{"type":54,"value":303},"在脚本编辑器的底部，您可以尝试输入数据来验证您刚才编写的 proto 文件内容是否正确。首先，请选择一个您希望进行测试的数据格式，例如 JSON。",{"type":48,"tag":216,"props":305,"children":306},{},[],{"type":48,"tag":210,"props":308,"children":309},{},[310],{"type":54,"value":311},"例",{"type":54,"value":313},"：根据之前的 ",{"type":48,"tag":154,"props":315,"children":317},{"className":316},[],[318],{"type":54,"value":280},{"type":54,"value":320}," 的定义，您可以输入以下的 JSON 数据和刚才的 Proto 名称来进行测试：",{"type":48,"tag":146,"props":322,"children":327},{"className":323,"code":325,"language":326,"meta":41},[324],"language-json","{\n  \"deviceId\": \"123456789\",\n  \"sensorType\": \"Temperature\",\n  \"value\": 24.5,\n  \"timestamp\": 1678339200000\n}\n","json",[328],{"type":48,"tag":154,"props":329,"children":330},{"__ignoreMap":41},[331],{"type":54,"value":325},{"type":48,"tag":216,"props":333,"children":334},{},[],{"type":54,"value":336},"输入完成后点击“测试”按钮。如果 proto 文件的定义有误，或者您输入的数据不符合 proto 文件的定义，MQTTX 客户端会显示相应的错误消息或提示，从而帮助您快速定位问题并进行调试。",{"type":48,"tag":216,"props":338,"children":339},{},[],{"type":54,"value":341},"当您确认输入数据与 proto 文件匹配，并且没有任何错误提示时，说明您的 proto 文件设置正确，可以继续后续的操作。",{"type":48,"tag":216,"props":343,"children":344},{},[],{"type":48,"tag":225,"props":346,"children":348},{"alt":298,"src":347,"loading":229,"decoding":230},"https://assets.emqx.com/images/b5e8037de4d6b44be4d42976d3892856.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":350,"children":351},{},[352,357,360,362],{"type":48,"tag":210,"props":353,"children":354},{},[355],{"type":54,"value":356},"运行脚本",{"type":48,"tag":216,"props":358,"children":359},{},[],{"type":54,"value":361},"在成功连接到 EMQX 后，您可以进一步使用您之前定义的 proto 文件来进行消息的编解码。",{"type":48,"tag":136,"props":363,"children":364},{},[365,382,392],{"type":48,"tag":140,"props":366,"children":367},{},[368,373,375,378],{"type":48,"tag":210,"props":369,"children":370},{},[371],{"type":54,"value":372},"选择运行脚本",{"type":54,"value":374},"：在连接页面的右上角，点击下拉菜单并选择“运行脚本”。",{"type":48,"tag":216,"props":376,"children":377},{},[],{"type":48,"tag":225,"props":379,"children":381},{"alt":372,"src":380,"loading":229,"decoding":230},"https://assets.emqx.com/images/703bbc7abc945f0d4836860bf631d665.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":383,"children":384},{},[385,390],{"type":48,"tag":210,"props":386,"children":387},{},[388],{"type":54,"value":389},"应用于消息的发送或接收",{"type":54,"value":391},"：在弹出的界面中，您可以选择该编解码是否应用于消息发送、接收或全部。根据您的实际场景来选择。本例中，我们选择默认的“全部”。",{"type":48,"tag":140,"props":393,"children":394},{},[395,400,402,408,410,413,417,420,425],{"type":48,"tag":210,"props":396,"children":397},{},[398],{"type":54,"value":399},"选择编解码脚本并设置类型名称",{"type":54,"value":401},"：在编解码下拉选择框中，选择您刚才创建或导入的 proto 文件。在“类型名称（即 Proto Name）”输入框中，输入您在 proto 文件中定义的消息名称，如 ",{"type":48,"tag":154,"props":403,"children":405},{"className":404},[],[406],{"type":54,"value":407},"IoT.SensorData",{"type":54,"value":409},"。确保所有设置都已正确配置后，点击“确认”按钮。",{"type":48,"tag":216,"props":411,"children":412},{},[],{"type":48,"tag":225,"props":414,"children":416},{"alt":399,"src":415,"loading":229,"decoding":230},"https://assets.emqx.com/images/11699524380f3becd7fd9882866680ee.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":216,"props":418,"children":419},{},[],{"type":48,"tag":210,"props":421,"children":422},{},[423],{"type":54,"value":424},"注意",{"type":54,"value":426},"：在这个教程中，我们将只关注编解码脚本的使用。尽管 MQTTX 客户端支持使用自定义函数，但在本教程中我们不会涉及这部分功能。",{"type":48,"tag":140,"props":428,"children":429},{},[430,435,438,440],{"type":48,"tag":210,"props":431,"children":432},{},[433],{"type":54,"value":434},"消息的收发",{"type":48,"tag":216,"props":436,"children":437},{},[],{"type":54,"value":439},"在完成了上述配置后，我们已经为 MQTTX 客户端配置了 Protobuf 编解码的功能。现在，我们将通过实际的消息收发来验证其效果。",{"type":48,"tag":136,"props":441,"children":442},{},[443,475,492],{"type":48,"tag":140,"props":444,"children":445},{},[446,451,453,462,465,467,473],{"type":48,"tag":210,"props":447,"children":448},{},[449],{"type":54,"value":450},"发布消息",{"type":54,"value":452},"：在消息输入框中，填入您预期的 JSON 数据，例如：",{"type":48,"tag":146,"props":454,"children":457},{"className":455,"code":456,"language":326,"meta":41},[324],"{\n  \"deviceId\": \"Device001\",\n  \"sensorType\": \"Temperature\",\n  \"value\": 23.5,\n  \"timestamp\": 1677328490320\n}\n",[458],{"type":48,"tag":154,"props":459,"children":460},{"__ignoreMap":41},[461],{"type":54,"value":456},{"type":48,"tag":216,"props":463,"children":464},{},[],{"type":54,"value":466},"然后，订阅一个名为 ",{"type":48,"tag":154,"props":468,"children":470},{"className":469},[],[471],{"type":54,"value":472},"testtopic/protobuf",{"type":54,"value":474}," 的主题，并向该主题发送上述消息。",{"type":48,"tag":140,"props":476,"children":477},{},[478,483,485,488],{"type":48,"tag":210,"props":479,"children":480},{},[481],{"type":54,"value":482},"接收并查看消息",{"type":54,"value":484},"：确保您已经订阅了上述主题。当消息到达时，您可以在接收窗口中看到 Protobuf 消息。选择 JSON 类型，将 Protobuf 消息转换为 JSON 格式进行查看。",{"type":48,"tag":216,"props":486,"children":487},{},[],{"type":48,"tag":225,"props":489,"children":491},{"alt":482,"src":490,"loading":229,"decoding":230},"https://assets.emqx.com/images/52058b41c62abe768bc10b7cfa355330.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":493,"children":494},{},[495,500],{"type":48,"tag":210,"props":496,"children":497},{},[498],{"type":54,"value":499},"验证消息处理",{"type":54,"value":501},"：在每条消息的顶部，有一个标签指示该消息是否经过了编解码处理。确保它显示为“已使用 xx 编解码”或类似的标识。如有任何错误或消息格式不符合预期的 proto 格式，MQTTX 客户端都会显示相应的错误提示。",{"type":48,"tag":57,"props":503,"children":504},{},[505],{"type":54,"value":506},"在完成上述步骤后，您已经在 MQTTX 客户端成功地启用了 Protobuf 的编解码功能，确保您通过 MQTT 发送或接收的消息都会按照 Protobuf 格式进行正确的序列化或反序列化。如需终止此功能，请点击顶部的“停止脚本”按钮。",{"type":48,"tag":49,"props":508,"children":510},{"id":509},"在-mqttx-命令行中使用-protobuf-消息",[511],{"type":54,"value":512},"在 MQTTX 命令行中使用 Protobuf 消息",{"type":48,"tag":57,"props":514,"children":515},{},[516],{"type":54,"value":517},"除了在 MQTTX 图形桌面客户端中利用 Protobuf 进行消息编解码，MQTTX 的命令行版本同样提供了完善的支持。对于熟悉控制台操作的用户，命令行版本提供了更直接且高效的操作方式。",{"type":48,"tag":57,"props":519,"children":520},{},[521],{"type":48,"tag":210,"props":522,"children":523},{},[524],{"type":54,"value":525},"使用 Protobuf 的命令行参数介绍",{"type":48,"tag":57,"props":527,"children":528},{},[529],{"type":54,"value":530},"在使用 MQTTX 命令行客户端处理 Protobuf 格式的消息时，您需要了解以下重要参数：",{"type":54,"value":532},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":48,"tag":534,"props":535,"children":536},"table",{},[537,556],{"type":48,"tag":538,"props":539,"children":540},"thead",{},[541],{"type":48,"tag":542,"props":543,"children":544},"tr",{},[545,551],{"type":48,"tag":546,"props":547,"children":548},"th",{},[549],{"type":54,"value":550},"参数",{"type":48,"tag":546,"props":552,"children":553},{},[554],{"type":54,"value":555},"描述",{"type":48,"tag":557,"props":558,"children":559},"tbody",{},[560,574],{"type":48,"tag":542,"props":561,"children":562},{},[563,569],{"type":48,"tag":564,"props":565,"children":566},"td",{},[567],{"type":54,"value":568},"Pp",{"type":48,"tag":564,"props":570,"children":571},{},[572],{"type":54,"value":573},"指定 Protobuf 消息格式的 .proto 文件路径。",{"type":48,"tag":542,"props":575,"children":576},{},[577,582],{"type":48,"tag":564,"props":578,"children":579},{},[580],{"type":54,"value":581},"Pmn",{"type":48,"tag":564,"props":583,"children":584},{},[585],{"type":54,"value":586},"定义 Protobuf 消息的类型名称。此名称必须与您的 .proto 文件中的定义相符。",{"type":48,"tag":203,"props":588,"children":589},{},[590,629,651,673],{"type":48,"tag":140,"props":591,"children":592},{},[593,598,600,606,608,611,613,618,620],{"type":48,"tag":210,"props":594,"children":595},{},[596],{"type":54,"value":597},"准备",{"type":54,"value":599}," ",{"type":48,"tag":154,"props":601,"children":603},{"className":602},[],[604],{"type":54,"value":605},".proto",{"type":54,"value":607}," 文件",{"type":48,"tag":216,"props":609,"children":610},{},[],{"type":54,"value":612},"首先，确保您已有一个定义好的 ",{"type":48,"tag":154,"props":614,"children":616},{"className":615},[],[617],{"type":54,"value":605},{"type":54,"value":619}," 文件，描述您希望传输的 Protobuf 消息格式。",{"type":48,"tag":146,"props":621,"children":624},{"className":622,"code":623,"language":264,"meta":41},[262],"syntax = \"proto3\";\n\npackage IoT;\n\nmessage SensorData {\n string deviceId = 1;\n string sensorType = 2;\n double value = 3;\n int64 timestamp = 4;\n}\n",[625],{"type":48,"tag":154,"props":626,"children":627},{"__ignoreMap":41},[628],{"type":54,"value":623},{"type":48,"tag":140,"props":630,"children":631},{},[632,637,640,642],{"type":48,"tag":210,"props":633,"children":634},{},[635],{"type":54,"value":636},"使用命令进行消息订阅",{"type":48,"tag":216,"props":638,"children":639},{},[],{"type":54,"value":641},"为了接收 Protobuf 格式的消息，您可以订阅一个特定的 MQTT 主题：",{"type":48,"tag":146,"props":643,"children":646},{"className":644,"code":645,"language":151,"meta":41},[149],"mqttx sub -t 'testtopic/protobuf' -h 127.0.0.1 -Pp ./SensorData.proto -Pmn IoT.SensorData\n",[647],{"type":48,"tag":154,"props":648,"children":649},{"__ignoreMap":41},[650],{"type":54,"value":645},{"type":48,"tag":140,"props":652,"children":653},{},[654,659,662,664],{"type":48,"tag":210,"props":655,"children":656},{},[657],{"type":54,"value":658},"使用命令进行消息发布",{"type":48,"tag":216,"props":660,"children":661},{},[],{"type":54,"value":663},"根据前面的参数介绍，现在我们可以发布一个 Protobuf 格式的消息：",{"type":48,"tag":146,"props":665,"children":668},{"className":666,"code":667,"language":151,"meta":41},[149],"mqttx pub -t 'testtopic/protobuf' -Pp ./SensorData.proto -Pmn IoT.SensorData -h 127.0.0.1 -m '{\"deviceId\":\"123456\", \"sensorType\": \"Temperature\", \"value\": 22.5, \"timestamp\": 1675873900}'\n",[669],{"type":48,"tag":154,"props":670,"children":671},{"__ignoreMap":41},[672],{"type":54,"value":667},{"type":48,"tag":140,"props":674,"children":675},{},[676,681,684,686,691,693,698,700,703],{"type":48,"tag":210,"props":677,"children":678},{},[679],{"type":54,"value":680},"查看接收到的 Protobuf 消息",{"type":48,"tag":216,"props":682,"children":683},{},[],{"type":54,"value":685},"在成功订阅后，您将能在命令行中观察到从 ",{"type":48,"tag":154,"props":687,"children":689},{"className":688},[],[690],{"type":54,"value":472},{"type":54,"value":692}," 主题所接收的 Protobuf 格式消息。此消息会根据您的 ",{"type":48,"tag":154,"props":694,"children":696},{"className":695},[],[697],{"type":54,"value":605},{"type":54,"value":699}," 文件定义进行解码后在命令行中显示，以便于您进行查看。",{"type":48,"tag":216,"props":701,"children":702},{},[],{"type":48,"tag":225,"props":704,"children":706},{"alt":680,"src":705,"loading":229,"decoding":230},"https://assets.emqx.com/images/31a58ffd73dfa4d87ef98407b0091e2d.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":57,"props":708,"children":709},{},[710,712,718,720,725],{"type":54,"value":711},"如果您希望查看的消息格式为 JSON，可以使用 ",{"type":48,"tag":154,"props":713,"children":715},{"className":714},[],[716],{"type":54,"value":717},"--format",{"type":54,"value":719}," 参数并将其设置为 ",{"type":48,"tag":154,"props":721,"children":723},{"className":722},[],[724],{"type":54,"value":326},{"type":54,"value":726},"。这将会把 Protobuf 消息转换为易于查看的 JSON 格式。",{"type":48,"tag":49,"props":728,"children":730},{"id":729},"使用-emqx-验证-protobuf-消息",[731],{"type":54,"value":732},"使用 EMQX 验证 Protobuf 消息",{"type":48,"tag":57,"props":734,"children":735},{},[736],{"type":54,"value":737},"最后，为确保您的消息的正确性，我们推荐使用 EMQX 5.1.1 企业版的编解码功能进行验证，通过解码和编码两个部分验证消息的正确性。",{"type":48,"tag":115,"props":739,"children":741},{"id":740},"解码场景",[742],{"type":54,"value":740},{"type":48,"tag":57,"props":744,"children":745},{},[746],{"type":54,"value":747},"设备发布使用 Protobuf 编码的消息至 MQTT 服务器。EMQX 规则引擎将捕获并根据定义的 Protobuf Schema 解码此消息，然后重发布到指定主题。",{"type":48,"tag":203,"props":749,"children":750},{},[751,832,916],{"type":48,"tag":140,"props":752,"children":753},{},[754,759,761],{"type":48,"tag":210,"props":755,"children":756},{},[757],{"type":54,"value":758},"创建 Protobuf Schema",{"type":54,"value":760},":",{"type":48,"tag":136,"props":762,"children":763},{},[764,777,820],{"type":48,"tag":140,"props":765,"children":766},{},[767,769,775],{"type":54,"value":768},"在 EMQX Dashboard 左侧导航栏中，选择",{"type":48,"tag":154,"props":770,"children":772},{"className":771},[],[773],{"type":54,"value":774},"数据集成 -> 编解码",{"type":54,"value":776},"。",{"type":48,"tag":140,"props":778,"children":779},{},[780,782],{"type":54,"value":781},"使用以下参数创建一个 Protobuf Schema:",{"type":48,"tag":136,"props":783,"children":784},{},[785,796,806],{"type":48,"tag":140,"props":786,"children":787},{},[788,790],{"type":54,"value":789},"名称: ",{"type":48,"tag":154,"props":791,"children":793},{"className":792},[],[794],{"type":54,"value":795},"protobuf_sensor",{"type":48,"tag":140,"props":797,"children":798},{},[799,801],{"type":54,"value":800},"类型: ",{"type":48,"tag":154,"props":802,"children":804},{"className":803},[],[805],{"type":54,"value":264},{"type":48,"tag":140,"props":807,"children":808},{},[809,811],{"type":54,"value":810},"Schema:",{"type":48,"tag":146,"props":812,"children":815},{"className":813,"code":814,"language":264,"meta":41},[262],"syntax = \"proto3\";\npackage IoT;\nmessage SensorData {\n   string deviceId = 1;\n   string sensorType = 2;\n   double value = 3;\n   int64 timestamp = 4;\n}\n",[816],{"type":48,"tag":154,"props":817,"children":818},{"__ignoreMap":41},[819],{"type":54,"value":814},{"type":48,"tag":140,"props":821,"children":822},{},[823,825,831],{"type":54,"value":824},"点击",{"type":48,"tag":154,"props":826,"children":828},{"className":827},[],[829],{"type":54,"value":830},"创建",{"type":54,"value":776},{"type":48,"tag":140,"props":833,"children":834},{},[835,840,841],{"type":48,"tag":210,"props":836,"children":837},{},[838],{"type":54,"value":839},"创建解码规则",{"type":54,"value":760},{"type":48,"tag":136,"props":842,"children":843},{},[844,856,872,884,896],{"type":48,"tag":140,"props":845,"children":846},{},[847,849,855],{"type":54,"value":848},"在左侧导航栏选择",{"type":48,"tag":154,"props":850,"children":852},{"className":851},[],[853],{"type":54,"value":854},"数据集成 -> 规则",{"type":54,"value":776},{"type":48,"tag":140,"props":857,"children":858},{},[859,861],{"type":54,"value":860},"在 SQL 编辑器中，写入:",{"type":48,"tag":146,"props":862,"children":867},{"className":863,"code":865,"language":866,"meta":41},[864],"language-sql","SELECT\n  schema_decode('protobuf_sensor', payload, 'SensorData') as sensor_data, payload\nFROM\n  \"t/#\"\nWHERE\n  sensor_data.deviceId = 'Device123'\n","sql",[868],{"type":48,"tag":154,"props":869,"children":870},{"__ignoreMap":41},[871],{"type":54,"value":865},{"type":48,"tag":140,"props":873,"children":874},{},[875,877,883],{"type":54,"value":876},"在动作下拉框中选择",{"type":48,"tag":154,"props":878,"children":880},{"className":879},[],[881],{"type":54,"value":882},"消息重发布",{"type":54,"value":776},{"type":48,"tag":140,"props":885,"children":886},{},[887,889,895],{"type":54,"value":888},"目标主题为",{"type":48,"tag":154,"props":890,"children":892},{"className":891},[],[893],{"type":54,"value":894},"sensor_data/${sensor_data.deviceId}",{"type":54,"value":776},{"type":48,"tag":140,"props":897,"children":898},{},[899,901,907,908,911],{"type":54,"value":900},"Payload 使用消息内容模板",{"type":48,"tag":154,"props":902,"children":904},{"className":903},[],[905],{"type":54,"value":906},"${sensor_data}",{"type":54,"value":776},{"type":48,"tag":216,"props":909,"children":910},{},[],{"type":48,"tag":225,"props":912,"children":915},{"alt":913,"src":914,"loading":229,"decoding":230},"查看规则","https://assets.emqx.com/images/6d6dec6bb7590c50b6c09725d6894ca8.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":917,"children":918},{},[919,924,925],{"type":48,"tag":210,"props":920,"children":921},{},[922],{"type":54,"value":923},"使用 MQTTX",{"type":54,"value":760},{"type":48,"tag":136,"props":926,"children":927},{},[928,933,945,965],{"type":48,"tag":140,"props":929,"children":930},{},[931],{"type":54,"value":932},"使用 MQTTX 作为 MQTT 客户端连接到 EMQX。",{"type":48,"tag":140,"props":934,"children":935},{},[936,938,944],{"type":54,"value":937},"在订阅区域，订阅主题 ",{"type":48,"tag":154,"props":939,"children":941},{"className":940},[],[942],{"type":54,"value":943},"sensor_data/#",{"type":54,"value":776},{"type":48,"tag":140,"props":946,"children":947},{},[948,950,955,957,963],{"type":54,"value":949},"将编解码脚本设置到发布端，并发送一个 Protobuf 编码的 ",{"type":48,"tag":154,"props":951,"children":953},{"className":952},[],[954],{"type":54,"value":280},{"type":54,"value":956}," 消息到 ",{"type":48,"tag":154,"props":958,"children":960},{"className":959},[],[961],{"type":54,"value":962},"t/1",{"type":54,"value":964}," 主题。",{"type":48,"tag":140,"props":966,"children":967},{},[968,970,976,978,981],{"type":54,"value":969},"在接收的 MQTTX 中，您应该可以看到主题为 ",{"type":48,"tag":154,"props":971,"children":973},{"className":972},[],[974],{"type":54,"value":975},"sensor_data/Device123",{"type":54,"value":977}," 的解码后的消息。",{"type":48,"tag":216,"props":979,"children":980},{},[],{"type":48,"tag":225,"props":982,"children":985},{"alt":983,"src":984,"loading":229,"decoding":230},"查看解码后的消息","https://assets.emqx.com/images/c3d0fc2a4764a91de42681944fd2faa7.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":115,"props":987,"children":989},{"id":988},"编码场景",[990],{"type":54,"value":988},{"type":48,"tag":57,"props":992,"children":993},{},[994],{"type":54,"value":995},"设备将 JSON 格式的消息发布到 MQTT 服务器。EMQX 规则引擎根据定义的 Protobuf Schema 将其编码为 Protobuf 格式，并重新发布到另一个主题。",{"type":48,"tag":203,"props":997,"children":998},{},[999,1008,1085],{"type":48,"tag":140,"props":1000,"children":1001},{},[1002,1007],{"type":48,"tag":210,"props":1003,"children":1004},{},[1005],{"type":54,"value":1006},"使用之前创建的 Schema",{"type":54,"value":776},{"type":48,"tag":140,"props":1009,"children":1010},{},[1011,1016,1017],{"type":48,"tag":210,"props":1012,"children":1013},{},[1014],{"type":54,"value":1015},"创建编码规则",{"type":54,"value":760},{"type":48,"tag":136,"props":1018,"children":1019},{},[1020,1031,1044,1054,1066],{"type":48,"tag":140,"props":1021,"children":1022},{},[1023,1025,1030],{"type":54,"value":1024},"同样在左侧导航栏选择",{"type":48,"tag":154,"props":1026,"children":1028},{"className":1027},[],[1029],{"type":54,"value":854},{"type":54,"value":776},{"type":48,"tag":140,"props":1032,"children":1033},{},[1034,1035],{"type":54,"value":860},{"type":48,"tag":146,"props":1036,"children":1039},{"className":1037,"code":1038,"language":866,"meta":41},[864],"SELECT\n  schema_encode('protobuf_sensor', json_decode(payload), 'SensorData') as protobuf_sensor\nFROM\n  \"t/#\"\n",[1040],{"type":48,"tag":154,"props":1041,"children":1042},{"__ignoreMap":41},[1043],{"type":54,"value":1038},{"type":48,"tag":140,"props":1045,"children":1046},{},[1047,1048,1053],{"type":54,"value":876},{"type":48,"tag":154,"props":1049,"children":1051},{"className":1050},[],[1052],{"type":54,"value":882},{"type":54,"value":776},{"type":48,"tag":140,"props":1055,"children":1056},{},[1057,1059,1065],{"type":54,"value":1058},"目标主题为 ",{"type":48,"tag":154,"props":1060,"children":1062},{"className":1061},[],[1063],{"type":54,"value":1064},"protobuf_out",{"type":54,"value":776},{"type":48,"tag":140,"props":1067,"children":1068},{},[1069,1071,1077,1078,1081],{"type":54,"value":1070},"Payload 使用消息内容模板 ",{"type":48,"tag":154,"props":1072,"children":1074},{"className":1073},[],[1075],{"type":54,"value":1076},"${protobuf_sensor}",{"type":54,"value":776},{"type":48,"tag":216,"props":1079,"children":1080},{},[],{"type":48,"tag":225,"props":1082,"children":1084},{"alt":913,"src":1083,"loading":229,"decoding":230},"https://assets.emqx.com/images/f876c8ee46f3ebe6b27cfcd355b62c2c.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":140,"props":1086,"children":1087},{},[1088,1093,1094],{"type":48,"tag":210,"props":1089,"children":1090},{},[1091],{"type":54,"value":1092},"使用 MQTTX 接收 Protobuf 消息",{"type":54,"value":760},{"type":48,"tag":136,"props":1095,"children":1096},{},[1097,1102,1123,1134,1139],{"type":48,"tag":140,"props":1098,"children":1099},{},[1100],{"type":54,"value":1101},"使用 MQTTX 连接到 EMQX。",{"type":48,"tag":140,"props":1103,"children":1104},{},[1105,1107,1112,1114],{"type":54,"value":1106},"在发布区域，输入主题 ",{"type":48,"tag":154,"props":1108,"children":1110},{"className":1109},[],[1111],{"type":54,"value":962},{"type":54,"value":1113}," 和指定的 JSON Payload，例如：",{"type":48,"tag":146,"props":1115,"children":1118},{"className":1116,"code":1117,"language":326,"meta":41},[324],"{\n  \"deviceId\": \"Device123\",\n  \"sensorType\": \"Temperature\",\n  \"value\": 24.5,\n  \"timestamp\": 1678339200000\n}\n",[1119],{"type":48,"tag":154,"props":1120,"children":1121},{"__ignoreMap":41},[1122],{"type":54,"value":1117},{"type":48,"tag":140,"props":1124,"children":1125},{},[1126,1128,1133],{"type":54,"value":1127},"将编解码脚本设置到接收端，并订阅一个 ",{"type":48,"tag":154,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":54,"value":1064},{"type":54,"value":964},{"type":48,"tag":140,"props":1135,"children":1136},{},[1137],{"type":54,"value":1138},"点击发布。",{"type":48,"tag":140,"props":1140,"children":1141},{},[1142,1144,1147],{"type":54,"value":1143},"在 MQTTX 中，您应该看到编码后的 Protobuf 消息。",{"type":48,"tag":216,"props":1145,"children":1146},{},[],{"type":48,"tag":225,"props":1148,"children":1151},{"alt":1149,"src":1150,"loading":229,"decoding":230},"编码后的 Protobuf 消息","https://assets.emqx.com/images/b16c4394d3afc5f467170cf5112bfbcc.png?x-image-process=image/resize,w_1520/format,webp",[],{"type":48,"tag":49,"props":1153,"children":1155},{"id":1154},"总结",[1156],{"type":54,"value":1154},{"type":48,"tag":57,"props":1158,"children":1159},{},[1160],{"type":54,"value":1161},"随着物联网行业的飞速发展，高效和紧凑的数据传输变得尤为重要。Protobuf 作为一种高效的数据序列化格式，可以与 MQTT 配合使用，确保迅速、精确和安全的数据交互。",{"type":48,"tag":57,"props":1163,"children":1164},{},[1165],{"type":54,"value":1166},"特别是在工业物联网领域，广受欢迎的数据传输标准 SparkplugB 就是采用了以 Protobuf 为核心的消息格式。因此，MQTTX 也可以轻松地通过 Protobuf 支持 SparkplugB 消息交互。为了进一步加强工业应用的表现，MQTTX 计划在未来进一步优化对 SparkplugB 的支持。",{"title":41,"searchDepth":1168,"depth":1168,"links":1169},2,[1170,1171,1176,1177,1178,1182],{"id":51,"depth":1168,"text":55},{"id":97,"depth":1168,"text":97,"children":1172},[1173,1175],{"id":117,"depth":1174,"text":120},3,{"id":174,"depth":1174,"text":177},{"id":193,"depth":1168,"text":196},{"id":509,"depth":1168,"text":512},{"id":729,"depth":1168,"text":732,"children":1179},[1180,1181],{"id":740,"depth":1174,"text":740},{"id":988,"depth":1174,"text":988},{"id":1154,"depth":1168,"text":1154},"markdown","content:blog:zh:how-to-publish-and-receive-protobuf-messages-within-mqtt.md","content","blog/zh/how-to-publish-and-receive-protobuf-messages-within-mqtt.md","md",{"loc":1189,"lastmod":30},"/zh/blog/how-to-publish-and-receive-protobuf-messages-within-mqtt",[1191,1199,1206,1212,1219,1226,1233,1239,1246,1253,1260,1267,1274,1275,1282,1289,1296,1303,1310,1316,1323,1330,1337,1344,1351,1358,1364,1371,1378,1385,1391,1398,1405],{"slug":1192,"title":1193,"description":1194,"date":1195,"category":1196,"cover":1197,"version":1198},"mqttx-1-13-2-released","MQTTX 1.13.2 发布：MQTTX Agent 与 Dashboard","MQTTX 1.13.2 通过 MQTTX Agent 自动执行 MQTT 测试、比对消息并排查问题，Dashboard 独立展示设备指标与趋势。","2026-10-26","release-notes","/images/blog/mqttx-1-13-2-released.webp","1.13.2",{"slug":1200,"title":1201,"description":1202,"date":1203,"category":1204,"cover":1205,"version":-1},"introducing-mqttx-ai-agent-skill","MQTTX AI Agent Skill 正式发布","MQTTX CLI 内置的 Agent Skill，让 AI 编码 Agent 能够正确、安全地完成 MQTT 连接检查、消息收发、压测与数据模拟。","2026-09-20","product","/images/blog/introducing-mqttx-ai-agent-skill.webp",{"slug":1207,"title":1208,"description":1209,"date":1203,"category":1196,"cover":1210,"version":1211},"mqttx-1-13-1-released","MQTTX 1.13.1 发布：AI Agent Skill 与 MQTT 5.0 订阅用户属性","MQTTX 1.13.1 新增 CLI Agent Skill 和 MQTT 5.0 订阅用户属性，同时改进数据导出、渲染安全与日常调试体验。","/images/blog/mqttx-1-13-1-released.webp","1.13.1",{"slug":1213,"title":1214,"description":1215,"date":1216,"category":1196,"cover":1217,"version":1218},"mqttx-1-13-0-released","MQTTX 1.13.0 发布：消息体查看器与 UI 优化","该版本带来了全新的消息体查看器功能，包含差异视图和 JSON 树视图，让消息调试更加直观高效。同时新增快速复制功能，支持一键复制 Topic、Payload 和连接地址。","2026-02-03","https://assets.emqx.com/images/8c7121a4362a9bfa897396a3fc8fefaa.png","1.13.0",{"slug":1220,"title":1221,"description":1222,"date":1223,"category":1196,"cover":1224,"version":1225},"mqttx-1-12-1-release-notes","MQTTX 1.12.1 发布：SCRAM 认证与安全增强","MQTTX 1.12.1 带来了重要的安全更新，包括全平台支持的 SCRAM 增强认证、修复了消息显示中的 XSS 漏洞、更新了 2025 年最新的 AI 模型，以及关键的稳定性改进。","2025-10-16","https://assets.emqx.com/images/8e89d5d55c44425251ab2b7e84fdb5c8.png","1.12.1",{"slug":1227,"title":1228,"description":1229,"date":1230,"category":1196,"cover":1231,"version":1232},"mqttx-1-12-0-release-notes","MQTTX 1.12.0 发布：Copilot 2.0 & 原生 MCP 集成","MQTTX 1.12.0 版本正式发布，带来了 Copilot 2.0 功能（集成 Gemini 2.5 Pro、Claude-4、GPT-4.1、o3/o4-mini、Azure OpenAI 等模型）。","2025-07-03","https://assets.emqx.com/images/2ff9750580cb332de42e887eef90dfb4.jpg","1.12.0",{"slug":1234,"title":1235,"description":1236,"date":1237,"category":1204,"cover":1238,"version":-1},"enhancing-mqtt-toolbox-with-ai-capabilities","MQTTX + MCP：MQTT 客户端秒变物联网 Agent","作为最受欢迎的 MQTT 客户端工具，MQTTX 在 1.12.0 beta 版本中集成了模型上下文协议（MCP）到 Copilot AI 功能中，显著提升了服务能力。","2025-04-17","https://assets.emqx.com/images/0414033f16fee53f3c8b8e3538a38fef.png",{"slug":1240,"title":1241,"description":1242,"date":1243,"category":1196,"cover":1244,"version":1245},"mqttx-1-11-1-release-notes","MQTTX 1.11.1 发布: 可视化功能增强","该版本增强了 MQTTX 的可视化功能，改进了主题树功能和实时流量监控。新增的流量速率监控功能为用户提供实时数据包追踪，主题树现在支持与连接列表的手动同步以及 MQTT 属性显示。","2024-12-20","https://assets.emqx.com/images/2f182bc8a29fb11bf11a6f39a67bec7c.jpg","1.11.1",{"slug":1247,"title":1248,"description":1249,"date":1250,"category":1196,"cover":1251,"version":1252},"mqttx-1-11-0-release-notes","MQTTX 1.11.0 发布：Topic Tree 与 Avro Schema","本次发布引入了 Topic Tree 可视化功能，提供了一种按层级组织和监控 MQTT 主题的强大新方式。","2024-10-29","https://assets.emqx.com/images/dba4e395e4043265d635384c6670c206.jpg","1.11.0",{"slug":1254,"title":1255,"description":1256,"date":1257,"category":1196,"cover":1258,"version":1259},"mqttx-1-10-1-release-notes","MQTTX 1.10.1 发布：桌面端一键安装命令行工具","本次更新带来了一系列提升用户体验的重要功能：通过桌面应用一键安装 MQTTX 命令行工具；增加对自定义 AI Copilot API 的支持，为中国区域内的用户提供内置的 Moonshot LLM API。","2024-07-25","https://assets.emqx.com/images/c83ea38e592729c4349f39fa8ee2883a.jpg","1.10.1",{"slug":1261,"title":1262,"description":1263,"date":1264,"category":1196,"cover":1265,"version":1266},"mqttx-1-10-0-release-notes","MQTTX 1.10.0 发布：CLI高级文件管理与配置","在本次更新中，CLI 版本在文件管理和配置功能方面进行了显著增强。主要更新包括：支持从文件中读取和写入消息、高级配置选项、文本输出模式、以及改进的日志记录。","2024-06-14","https://assets.emqx.com/images/76adac845cbb113915947ca5b76631a5.jpg","1.10.0",{"slug":1268,"title":1269,"description":1270,"date":1271,"category":1196,"cover":1272,"version":1273},"mqttx-1-9-10-release-notes","MQTTX 1.9.10 发布：升级 Faker.js、增强连接与订阅诊断、优化 UI","MQTTX 1.9.10 引入了一项关键更新：将 Faker.js 升级到 v8，带来重大变更。此次升级将影响那些使用自定义模拟脚本的用户，需要对脚本进行修改以保持与新版本的兼容。","2024-04-25","https://assets.emqx.com/images/f4a343ea4a9accc7c2b9047e2ee992aa.png","1.9.10",{"slug":27,"title":28,"description":29,"date":30,"category":31,"cover":32,"version":-1},{"slug":1276,"title":1277,"description":1278,"date":1279,"category":1196,"cover":1280,"version":1281},"mqttx-1-9-9-release-notes","MQTTX 1.9.9 发布：新增日志级别自定义功能、UI 增强","MQTTX 1.9.9 现已正式发布。该版本带来了多项关键更新：包括优化连接事件的处理、新增 CBOR 数据格式支持、提供可定制的调试日志级别以及增强用户界面灵活性。","2024-02-21","https://assets.emqx.com/images/2f5c68eb83929b730860399f9486ae21.png","1.9.9",{"slug":1283,"title":1284,"description":1285,"date":1286,"category":1196,"cover":1287,"version":1288},"mqttx-1-9-8-release-notes","MQTTX 1.9.8 发布：CLI 支持调试模式、AI Copilot 增强","MQTTX 1.9.8 现已发布，新版本中 MQTTX CLI 新增了调试模式，这一功能增强了开发者的故障排查和分析能力。此外，更新也改进了 MQTTX AI Copilot 功能，为用户提供了更先进的基于 AI 驱动的 MQTT 交互支持。","2024-01-29","https://assets.emqx.com/images/5624cf41d474bf0cf8b6aaa47cf09c1f.png","1.9.8",{"slug":1290,"title":1291,"description":1292,"date":1293,"category":1196,"cover":1294,"version":1295},"mqttx-1-9-7-release-notes","MQTTX 1.9.7 更新：MQTTX AI Copilot 发布","此次更新的一大亮点是引入了 MQTTX Copilot，全新的 MQTT AI 助手，为用户提供更方便、快捷的使用体验。AI 助手能增强用户互动，帮助用户更深入理解并使用 MQTT 和 EMQX。","2024-01-22","https://assets.emqx.com/images/18f1a0ab5e4967d46c2b9d351da052a4.png","1.9.7",{"slug":1297,"title":1298,"description":1299,"date":1300,"category":1196,"cover":1301,"version":1302},"mqttx-v-1-9-6-release-notes","MQTTX 1.9.6 发布：ALPN 协议支持，UI 持续优化","本次更新主要重点在于加强连接协议、并对用户界面进行了优化，旨在提供一个更高效、安全和用户友好的体验。","2023-09-26","https://assets.emqx.com/images/359278439c384548665bfb0388f0aa24.png","1.9.6",{"slug":1304,"title":1305,"description":1306,"date":1307,"category":1196,"cover":1308,"version":1309},"mqttx-1-9-5-released-json-message-highlighting-and-more","MQTTX 1.9.5 发布：JSON 消息高亮显示","MQTT 5.0 客户端工具 MQTTX 1.9.5 正式发布。本次更新中，我们主要针对桌面客户端强化了 JSON 语法的错误消息提示，并在消息中增加了 JSON 高亮的支持。此外，我们还对 UI 进行了多项修改和优化，以进一步增强用户体验。","2023-08-25","https://assets.emqx.com/images/f82115ce699de70fb54e8f45adacf878.png","1.9.5",{"slug":1311,"title":1312,"description":1313,"date":1314,"category":31,"cover":1315,"version":-1},"demonstrate-mqtt-5-0-features-using-mqttx-cli","探索 MQTT 5.0 新特性：基于 MQTTX CLI 的使用示例","为了让大家更全面地了解 MQTT 5.0，本文将依次介绍 5.0 引入的各个新特性，并使用 MQTTX CLI 工具演示我们应该如何在 EMQX 中使用这些特性，你可以通过复制和粘贴命令轻松地运行本文中的示例。","2023-08-23","https://assets.emqx.com/images/35e43ae683c590cf512c62cf11a7e8cd.png",{"slug":1317,"title":1318,"description":1319,"date":1320,"category":1196,"cover":1321,"version":1322},"mqttx-v-1-9-4-release-notes","MQTTX 1.9.4 发布：全面支持 Protobuf 格式 MQTT 消息传输测试","MQTTX 1.9.4 正式发布：本次更新为用户提供了更高效的 Protobuf 消息传输支持，并优化了自动更新功能，同时进行了一些功能特性的优化和增强。","2023-08-01","https://assets.emqx.com/images/cde7c8e2e51e7398057cb8e11d811192.png","1.9.4",{"slug":1324,"title":1325,"description":1326,"date":1327,"category":1196,"cover":1328,"version":1329},"mqttx-1-9-3-introduces-powerful-iot-scenario-data-simulation-feature","提升开发效率：MQTTX 1.9.3 推出强大的 IoT 场景数据模拟功能","MQTTX 1.9.3 为命令行客户端带来了一项重要增强：开发者可以模拟 IoT 场景数据，满足特定的测试需求。","2023-05-29","https://assets.emqx.com/images/657ba5a04f29a7b318206a642223db8f.png","1.9.3",{"slug":1331,"title":1332,"description":1333,"date":1334,"category":1196,"cover":1335,"version":1336},"mqttx-v-1-9-2-release-notes","MQTTX 1.9.2 发布：更出色的 MQTT 客户端工具箱","v1.9.2 支持命令行工具的输出模式，用户可以根据需要自定义数据管道，从而更便捷、高效地处理输出数据。","2023-04-27","https://assets.emqx.com/images/44cad865821d28706395fd74e8bd766a.png","1.9.2",{"slug":1338,"title":1339,"description":1340,"date":1341,"category":1196,"cover":1342,"version":1343},"mqttx-v-1-9-1-release-notes","MQTTX 1.9.1 发布：资源消耗降低 80%，稳定性大幅提升","MQTT 5.0 客户端工具 MQTT X 1.9.1 稳定版本正式发布，CPU 资源消耗与内存占用减少 80%，整体性能得到大幅优化。","2023-02-10","https://assets.emqx.com/images/c7f10755128e074ae4e28cd8139b790f.png","1.9.1",{"slug":1345,"title":1346,"description":1347,"date":1348,"category":1196,"cover":1349,"version":1350},"mqttx-v-1-9-0-release-notes","MQTTX 1.9.0 发布：开箱即用的 bench 命令，MQTT 性能测试更便捷","近日，MQTT 5.0 客户端工具 MQTT X 1.9.0 正式发布：命令行客户端新增了 bench 命令，帮助用户轻松完成 MQTT 服务的性能测试。","2022-11-15","https://assets.emqx.com/images/c5a4b83637473e6e414b11101046771f.png","1.9.0",{"slug":1352,"title":1353,"description":1354,"date":1355,"category":1196,"cover":1356,"version":1357},"mqttx-v-1-8-3-release-notes","MQTTX v1.8.3 正式发布","MQTT X v1.8.3 优化了 MQTT 5.0 Clean Start 的使用方式，为会话过期间隔添加默认值；同时也改进了 MQTT X CLI 的默认输出显示。","2022-10-20","https://assets.emqx.com/images/a9fd38699c5731bd4210c81297ac8af4.png","1.8.3",{"slug":1359,"title":1360,"description":1361,"date":1362,"category":1204,"cover":1363,"version":-1},"powerful-and-easy-to-use-mqtt-5-command-line-tool","MQTTX CLI 发布：强大易用的 MQTT 5.0 命令行工具","MQTT X v1.8.0 发布：除了通过新增的快速复制连接功能优化使用体验之外，还增加了 CLI（命令行） 和 Web 端这两种新的交互方式 。","2022-07-21","https://assets.emqx.com/images/2780d4b1fe9f0f3c0792515feb90b1e1.png",{"slug":1365,"title":1366,"description":1367,"date":1368,"category":1196,"cover":1369,"version":1370},"mqttx-v-1-7-2-release-notes","MQTTX v1.7.2 正式发布","MQTT X v1.7.1 正式发布：支持设置重连周期，增加更多的 ARM 包，共享订阅支持 Topic 颜色标记。","2022-01-28","https://assets.emqx.com/images/241fe4ef50adbfdea9e43979028757b2.png","1.7.2",{"slug":1372,"title":1373,"description":1374,"date":1375,"category":1196,"cover":1376,"version":1377},"mqttx-v-1-7-1-release-notes","MQTTX v1.7.1 正式发布","MQTT X v1.7.1 正式发布，新增支持 MQTT 5.0 订阅标识符、 编辑/启用/禁用 Topic、并优化了 MQTT 5.0 的属性展示。","2022-01-18","https://assets.emqx.com/images/a2df1acb1d15e7e9378ec9e1ebcdc716.png","1.7.1",{"slug":1379,"title":1380,"description":1381,"date":1382,"category":1196,"cover":1383,"version":1384},"mqttx-v-1-7-0-release-notes","MQTTX v1.7.0 发布：率先支持 MQTT 5.0 新特性的桌面测试客户端","MQTT X v1.7.0 新增很多关于 MQTT 5.0 的属性配置功能支持，使其成为目前同类工具中支持 MQTT 5.0 最为完整的 MQTT 桌面客户端工具。","2021-12-16","https://assets.emqx.com/images/6ed96b88a4524e11609b2e4fd792574c.png","1.7.0",{"slug":1386,"title":1387,"description":1388,"date":1389,"category":31,"cover":1390,"version":-1},"mqttx-script-function-tutorial","MQTTX 脚本功能使用教程","MQTT X 在 v1.4.2 版本后加入了脚本功能，用户可使用脚本对 Payload 进行自定义转换，本文将通过两个简单的实例来介绍脚本功能的使用。","2021-02-23","https://assets.emqx.com/images/d9b2744f485887c9fae26133ed2e4b14.png",{"slug":1392,"title":1393,"description":1394,"date":1395,"category":1196,"cover":1396,"version":1397},"mqttx-v-1-4-2-release-notes","MQTTX v1.4.2 正式发布 - 跨平台 MQTT 5.0 桌面客户端","MQTT X v1.4.2 正式发布，新增脚本功能、Client ID 自动加入时间戳，并优化了部分功能。","2020-12-19","https://assets.emqx.com/images/8a061565b6d6ce57580c371bc27b63dc.png","1.4.2",{"slug":1399,"title":1400,"description":1401,"date":1402,"category":1196,"cover":1403,"version":1404},"mqttx-v-1-3-1-release-notes","MQTTX v1.3.1 发布 - 跨平台 MQTT 5.0 客户端工具","该版本新增： MQTT 5.0 更多属性、单击已订阅的 Topic 项实现消息过滤、点击 Topic 名称后快速复制 Topic 信息、启用严格的证书验证选项。","2020-05-15","https://assets.emqx.com/images/daebe4ee5cf1a736923d821c30949aa2.png","1.3.1",{"slug":1406,"title":1407,"description":1408,"date":1409,"category":1196,"cover":1410,"version":1411},"mqttx-v1-3-0-was-officially-released-an-elegant-cross-platform-mqtt5-desktop-test-client","MQTTX v1.3.0 正式发布 - 跨平台 MQTT 5.0 桌面测试客户端","MQTT X 是由 EMQ 开源的一款跨平台 MQTT 5.0 桌面测试客户端，它支持 macOS，Linux，Windows。用户可以使用 MQTT X 快速创建多个同时在线的 MQTT 客户端，方便测试 MQTT/TCP、MQTT/TLS 的连接/发布/订阅功能及其他 MQTT 协议 特性。","2020-03-19","https://assets.emqx.com/images/a6221d0ffcaad5c8019e239340833f44.png","1.3.0",1793585625777]