{"id":3935,"date":"2024-04-28T13:51:51","date_gmt":"2024-04-28T05:51:51","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/springboot%e6%95%b4%e5%90%88mqtt%e5%ae%9e%e7%8e%b0%e6%b6%88%e6%81%af%e5%8f%91%e9%80%81%e5%92%8c%e6%b6%88%e8%b4%b9%ef%bc%8c%e4%bb%a5%e5%8f%8a%e5%ae%a2%e6%88%b7%e7%ab%af%e6%96%ad%e7%ba%bf%e9%87%8d\/"},"modified":"2024-05-24T15:12:32","modified_gmt":"2024-05-24T07:12:32","slug":"springboot%e6%95%b4%e5%90%88mqtt%e5%ae%9e%e7%8e%b0%e6%b6%88%e6%81%af%e5%8f%91%e9%80%81%e5%92%8c%e6%b6%88%e8%b4%b9%ef%bc%8c%e4%bb%a5%e5%8f%8a%e5%ae%a2%e6%88%b7%e7%ab%af%e6%96%ad%e7%ba%bf%e9%87%8d","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/springboot%e6%95%b4%e5%90%88mqtt%e5%ae%9e%e7%8e%b0%e6%b6%88%e6%81%af%e5%8f%91%e9%80%81%e5%92%8c%e6%b6%88%e8%b4%b9%ef%bc%8c%e4%bb%a5%e5%8f%8a%e5%ae%a2%e6%88%b7%e7%ab%af%e6%96%ad%e7%ba%bf%e9%87%8d\/","title":{"rendered":"springboot\u6574\u5408mqtt\u5b9e\u73b0\u6d88\u606f\u53d1\u9001\u548c\u6d88\u8d39\uff0c\u4ee5\u53ca\u5ba2\u6237\u7aef\u65ad\u7ebf\u91cd\u8fde\u4e4b\u540e\u7684\u6d88\u606f\u6062\u590d"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<p style=\"text-align: center; margin-bottom: 0px;\"><img decoding=\"async\" class=\"rich_pages js_insertlocalimg wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007699\" data-ratio=\"0.2777777777777778\" data-s=\"300,640\" data-type=\"gif\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages js_insertlocalimg wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif\" data-imgfileid=\"100007699\" data-ratio=\"0.2777777777777778\" data-s=\"300,640\" data-type=\"gif\" data-w=\"1080\" \/><\/noscript><\/p>\n<section style=\"margin-bottom: 0px; padding-left: 10px; padding-right: 10px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; color: #000000; line-height: 1.5em; word-spacing: 0em; letter-spacing: 0em; word-break: break-word; text-align: left;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\">\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; border: 1px none #000000;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #0e8aeb; line-height: 1.8em; letter-spacing: 0em; padding-left: 10px; border-style: none none none solid; border-width: 1px 1px 1px 5px; border-color: #000000 #000000 #000000 #0e88eb; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">MQTT\u7b80\u4ecb<\/span><\/h2>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">MQTT\u662f\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u7684\u8f7b\u91cf\u7ea7\u901a\u8baf\u534f\u8bae\uff0c\u8be5\u534f\u8bae\u6784\u5efa\u5728TCP\/IP\u534f\u8bae\u4e0a\u3002 MQTT\u6700\u5927\u7684\u6709\u70b9\u5728\u4e8e\u53ef\u4ee5\u4ee5\u6781\u5c11\u7684\u4ee3\u7801\u548c\u6709\u9650\u7684\u5e26\u5bbd\uff0c\u4e3a\u8fdc\u7a0b\u8bbe\u5907\u63d0\u4f9b\u5b9e\u65f6\u53ef\u9760\u7684\u6d88\u606f\u670d\u52a1\u3002\u505a\u4e3a\u4e00\u79cd\u4f4e\u5f00\u9500\u3001\u4f4e\u5e26\u5bbd\u5360\u7528\u7684\u5373\u65f6\u901a\u8baf\u534f\u8bae\uff0cMQTT\u5728\u7269\u8054\u7f51\u3001\u5c0f\u578b\u8bbe\u5907\u3001\u79fb\u52a8\u5e94\u7528\u7b49\u65b9\u9762\u6709\u5e7f\u6cdb\u5e94\u7528\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #0e88eb; line-height: 1.5em; letter-spacing: 0em; font-weight: bold; display: block;\">\u7279\u70b9<\/span><\/h3>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u5f00\u653e\u6d88\u606f\u534f\u8bae\uff0c\u7b80\u5355\u6613\u5b9e\u73b0<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u53d1\u5e03\u8ba2\u9605\u6a21\u5f0f\uff0c\u4e00\u5bf9\u591a\u6d88\u606f\u53d1\u5e03<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u57fa\u4e8eTCP\/IP\u7f51\u7edc\u8fde\u63a5\uff0c\u63d0\u4f9b\u6709\u5e8f\uff0c\u65e0\u635f\uff0c\u53cc\u5411\u8fde\u63a5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">2\u5b57\u8282\u56fa\u5b9a\u62a5\u5934\uff0c2\u5b57\u8282\u5fc3\u8df3\u62a5\u6587\uff0c\u6700\u5c0f\u5316\u4f20\u8f93\u5f00\u9500\u548c\u534f\u8bae\u4ea4\u6362\uff0c\u6709\u6548\u51cf\u5c11\u7f51\u7edc\u6d41\u91cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u6d88\u606fQoS\u652f\u6301\uff0c\u53ef\u9760\u4f20\u8f93\u4fdd\u8bc1<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #0e88eb; line-height: 1.5em; letter-spacing: 0em; font-weight: bold; display: block;\">\u5e94\u7528<\/span><\/h3>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u7269\u8054\u7f51M2M\u901a\u4fe1\uff0c\u7269\u8054\u7f51\u5927\u6570\u636e\u91c7\u96c6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">Android\u6d88\u606f\u63a8\u9001\uff0cWEB\u6d88\u606f\u63a8\u9001<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u667a\u80fd\u786c\u4ef6\u3001\u667a\u80fd\u5bb6\u5177\u3001\u667a\u80fd\u7535\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u8f66\u8054\u7f51\u901a\u4fe1\uff0c\u7535\u52a8\u8f66\u7ad9\u6869\u91c7\u96c6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u667a\u6167\u57ce\u5e02\u3001\u8fdc\u7a0b\u533b\u7597\u3001\u8fdc\u7a0b\u6559\u80b2<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #010101; font-size: 15px; line-height: 1.8em; letter-spacing: 0em;\">\u7535\u529b\u3001\u77f3\u6cb9\u4e0e\u80fd\u6e90\u7b49\u884c\u4e1a\u5e02\u573a<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #0e88eb; line-height: 1.5em; letter-spacing: 0em; font-weight: bold; display: block;\">MQTT\u63a7\u5236\u62a5\u6587\u7684\u7ed3\u6784<\/span><\/h3>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">MQTT\u901a\u8fc7\u4ea4\u6362\u4e00\u4e9b\u9884\u5b9a\u4e49\u7684MQTT\u63a7\u5236\u62a5\u6587\u6765\u5de5\u4f5c\uff0c\u6bcf\u6761MQTT\u547d\u4ee4\u6d88\u606f\u7684\u6d88\u606f\u5934\u90fd\u5305\u542b\u4e00\u4e2a\u56fa\u5b9a\u7684\u62a5\u5934\uff0c\u6709\u4e9b\u6d88\u606f\u4f1a\u643a\u5e26\u4e00\u4e2a\u53ef\u53d8\u62a5\u6587\u5934\u548c\u4e00\u4e2a\u8d1f\u8377\u3002\u6d88\u606f\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; font-size: 12px;\"><span style=\"color: #c678dd; line-height: 26px;\">package<\/span>com.xdemo.mqttconsumer.controller;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>com.xdemo.mqttconsumer.mqtt.MqttConsumerConfig;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>org.springframework.beans.factory.annotation.Autowired;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>org.springframework.beans.factory.annotation.Value;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>org.springframework.stereotype.Controller;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>org.springframework.web.bind.annotation.RequestMapping;<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>org.springframework.web.bind.annotation.ResponseBody;<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/***<span style=\"color: #c678dd; line-height: 26px;\">@Author<\/span>:xdemo*<span style=\"color: #c678dd; line-height: 26px;\">@Date<\/span>:2021\/7\/3017:20*<span style=\"color: #c678dd; line-height: 26px;\">@Description<\/span>:*\/<\/span><span style=\"color: #61aeee; line-height: 26px;\">@Controller<\/span><span style=\"color: #c678dd; line-height: 26px;\">public<\/span><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">class<\/span><span style=\"color: #e6c07b; line-height: 26px;\">TestController<\/span><\/span>{<span style=\"color: #61aeee; line-height: 26px;\">@Autowired<\/span><span style=\"color: #c678dd; line-height: 26px;\">private<\/span>MqttConsumerConfigclient;<span style=\"color: #61aeee; line-height: 26px;\">@Value<\/span>(<span style=\"color: #98c379; line-height: 26px;\">\"${spring.mqtt.client.id}\"<\/span>)<span style=\"color: #c678dd; line-height: 26px;\">private<\/span>StringclientId;<span style=\"color: #61aeee; line-height: 26px;\">@RequestMapping<\/span>(<span style=\"color: #98c379; line-height: 26px;\">\"connect\"<\/span>)<span style=\"color: #61aeee; line-height: 26px;\">@ResponseBody<\/span><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>String<span style=\"color: #61aeee; line-height: 26px;\">connect<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>{client.connect();<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>clientId+<span style=\"color: #98c379; line-height: 26px;\">\"\u8fde\u63a5\u5230\u670d\u52a1\u5668\"<\/span>;}<span style=\"color: #61aeee; line-height: 26px;\">@RequestMapping<\/span>(<span style=\"color: #98c379; line-height: 26px;\">\"disConnect\"<\/span>)<span style=\"color: #61aeee; line-height: 26px;\">@ResponseBody<\/span><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>String<span style=\"color: #61aeee; line-height: 26px;\">disConnect<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>{client.disConnect();<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>clientId+<span style=\"color: #98c379; line-height: 26px;\">\"\u4e0e\u670d\u52a1\u5668\u65ad\u5f00\u8fde\u63a5\"<\/span>;}}<\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6d4b\u8bd5<\/p>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5206\u522b\u542f\u52a8\u4e24\u4e2a\u9879\u76ee\uff0c\u53ef\u4ee5\u5728\u7ba1\u7406\u754c\u9762\u770b\u5230\u521b\u5efa\u7684\u4e24\u4e2a\u5ba2\u6237\u7aef<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143614778.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007711\" data-ratio=\"0.30231335436382756\" data-type=\"png\" data-w=\"3804\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143614778.png\" data-imgfileid=\"100007711\" data-ratio=\"0.30231335436382756\" data-type=\"png\" data-w=\"3804\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8c03\u7528\u53d1\u5e03\u6d88\u606f\u63a5\u53e3\u53d1\u5e03\u6d88\u606f<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143617815.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007710\" data-ratio=\"0.6024915062287656\" data-type=\"png\" data-w=\"1766\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143617815.png\" data-imgfileid=\"100007710\" data-ratio=\"0.6024915062287656\" data-type=\"png\" data-w=\"1766\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6d88\u8d39\u8005\u63a7\u5236\u53f0\u6253\u5370<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"lazyload\"style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143620102.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007708\" data-ratio=\"0.28299894403379094\" data-type=\"png\" data-w=\"1894\" \/><noscript><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143620102.png\" data-imgfileid=\"100007708\" data-ratio=\"0.28299894403379094\" data-type=\"png\" data-w=\"1894\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5ba2\u6237\u7aef\u65ad\u7ebf\u6d88\u606f\u6062\u590d<\/p>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u628a\u6d88\u8d39\u8005\u4e0e\u670d\u52a1\u7aef\u65ad\u5f00\u8fde\u63a5<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143624794.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007709\" data-ratio=\"0.6176470588235294\" data-type=\"png\" data-w=\"1836\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143624794.png\" data-imgfileid=\"100007709\" data-ratio=\"0.6176470588235294\" data-type=\"png\" data-w=\"1836\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u518d\u8c03\u7528\u53d1\u5e03\u6d88\u606f\u63a5\u53e3\u53d1\u9001\u4e24\u6761\u6d88\u606f\u5230topic1\uff0c\u7136\u540e\u518d\u628a\u6d88\u8d39\u8005\u8fde\u63a5\u5230\u670d\u52a1\u7aef<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"lazyload\"style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143626377.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007717\" data-ratio=\"0.5757918552036199\" data-type=\"png\" data-w=\"1768\" \/><noscript><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143626377.png\" data-imgfileid=\"100007717\" data-ratio=\"0.5757918552036199\" data-type=\"png\" data-w=\"1768\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u63a7\u5236\u53f0\u6ca1\u6709\u4e1c\u897f\u6253\u5370<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"lazyload\"style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143629804.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007716\" data-ratio=\"0.34782608695652173\" data-type=\"png\" data-w=\"1564\" \/><noscript><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143629804.png\" data-imgfileid=\"100007716\" data-ratio=\"0.34782608695652173\" data-type=\"png\" data-w=\"1564\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4fee\u6539\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u914d\u7f6e\uff0c\u628asetCleanSession\u6539\u4e3afalse<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143632507.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007714\" data-ratio=\"0.21577726218097448\" data-type=\"png\" data-w=\"1724\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143632507.png\" data-imgfileid=\"100007714\" data-ratio=\"0.21577726218097448\" data-type=\"png\" data-w=\"1724\" \/><\/noscript><\/figure>\n<p style=\"font-size: 15px; line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u91cd\u542f\u9879\u76ee\uff0c\u628a\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u65ad\u5f00\u8fde\u63a5\uff0c\u8c03\u7528\u53d1\u5e03\u6d88\u606f\u63a5\u53e3\u53d1\u5e03\u4e24\u6761\u6d88\u606f\uff0c\u518d\u628a\u6d88\u8d39\u8005\u548c\u670d\u52a1\u7aef\u8fde\u63a5\u4e0a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143636672.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100007715\" data-ratio=\"0.5\" data-type=\"png\" data-w=\"2664\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; object-fit: fill; box-shadow: #85a1c9 0px 0px 5px 0px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143636672.png\" data-imgfileid=\"100007715\" data-ratio=\"0.5\" data-type=\"png\" data-w=\"2664\" \/><\/noscript><\/figure>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; max-width: 100%; min-height: 1em; color: #000000; font-size: 16px; line-height: 26px; text-align: center; overflow-wrap: break-word !important; box-sizing: border-box !important; margin-bottom: 0px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"max-width: 100%; overflow-wrap: break-word !important; box-sizing: border-box !important;\">\u5b8c<\/strong><\/p>\n<p style=\"text-align: center; margin-bottom: 0px;\">\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: Java\u67b6\u6784\u5386\u7a0b<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>MQTT\u7b80\u4ecb MQTT\u662f\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u7684\u8f7b\u91cf\u7ea7\u901a\u8baf\u534f\u8bae\uff0c\u8be5\u534f\u8bae\u6784\u5efa\u5728TCP\/IP\u534f\u8bae\u4e0a\u3002 MQTT\u6700\u5927\u7684\u6709\u70b9\u5728\u4e8e\u53ef\u4ee5\u4ee5\u6781\u5c11 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3914,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-3935","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677-300x127.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677-1024x434.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677-300x127.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677-1024x434.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143516677.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143521215.gif","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143614778.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143614778.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143617815.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143617815.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143620102.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143620102.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143624794.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143624794.png","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143626377.png","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143626377.png","id":"image11"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143629804.png","id":"image12"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143629804.png","id":"image13"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143632507.png","id":"image14"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143632507.png","id":"image15"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143636672.png","id":"image16"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524143636672.png","id":"image17"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2024-04-28","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":409,"next_post_id":4216,"next_post_title":"Spring Boot\u8de8\u57df\u95ee\u9898\u89e3\u51b3","previous_post_id":4238,"previous_post_title":"Spring Boot\u6574\u5408RabbitMQ","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3935"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3935\/revisions"}],"predecessor-version":[{"id":4184,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3935\/revisions\/4184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/3914"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}