{"id":6253,"date":"2024-08-01T22:47:38","date_gmt":"2024-08-01T14:47:38","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=6253"},"modified":"2024-08-01T22:47:38","modified_gmt":"2024-08-01T14:47:38","slug":"%e8%bf%99%e6%89%8d%e6%98%afrabbitmq%e6%89%93%e5%bc%80%e7%9a%84%e6%ad%a3%e7%a1%ae%e5%a7%bf%e5%8a%bf-%e4%b8%83%e7%a7%8d%e6%b6%88%e6%81%af%e6%a8%a1%e5%9e%8b%e7%90%86%e8%ae%ba-%e5%9b%be%e6%96%87","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/rabbitmq\/%e8%bf%99%e6%89%8d%e6%98%afrabbitmq%e6%89%93%e5%bc%80%e7%9a%84%e6%ad%a3%e7%a1%ae%e5%a7%bf%e5%8a%bf-%e4%b8%83%e7%a7%8d%e6%b6%88%e6%81%af%e6%a8%a1%e5%9e%8b%e7%90%86%e8%ae%ba-%e5%9b%be%e6%96%87\/","title":{"rendered":"\u8fd9\u624d\u662fRabbitMQ\u6253\u5f00\u7684\u6b63\u786e\u59ff\u52bf , \u4e03\u79cd\u6d88\u606f\u6a21\u578b\u7406\u8bba + \u56fe\u6587 + \u4ee3\u7801\u89e3\u6790, \u61c2\u4e86"},"content":{"rendered":"<div class='wxsyncmain'>\n<p><ne-clipboard source=\"https%3A%2F%2Fwww.yuque.com%2Fliuxiansheng-zmauq%2Fzfp4lc%2Frplry2purq1qq883\"><\/ne-clipboard><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">1.\u4ec0\u4e48\u662fMQ?\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528MQ<\/h1>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">MQ\uff1aMessageQueue\uff0c\u6d88\u606f\u961f\u5217\u3002 \u961f\u5217\uff0c\u662f\u4e00\u79cdFIFO \u5148\u8fdb\u5148\u51fa\u7684\u6570\u636e\u7ed3\u6784\u3002\u6d88\u606f\u7531\u751f\u4ea7\u8005\u53d1\u9001\u5230MQ\u8fdb\u884c\u6392\u961f\uff0c\u7136\u540e\u6309\u539f\u6765\u7684\u987a\u5e8f\u4ea4\u7531\u6d88\u606f\u7684\u6d88\u8d39\u8005\u8fdb\u884c\u5904\u7406\u3002QQ\u548c\u5fae\u4fe1\u5c31\u662f\u5178\u578b\u7684MQ\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">MQ\u7684\u4f5c\u7528\u4e3b\u8981\u6709\u4ee5\u4e0b\u4e09\u4e2a\u65b9\u9762\uff1a<\/span><\/p>\n<h2 data-lake-index-type=\"0\" style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span lake-read-ignore=\"true\">1. <\/span><span style=\"color: rgb(51, 51, 51);\">\u5f02\u6b65<\/span><\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f8b\u5b50\uff1a<\/span><span style=\"color: rgb(25, 27, 31);\">\u6bd4\u5982\u6211\u4eec\u6700\u5e38\u89c1\u7684\u77ed\u4fe1\u9a8c\u8bc1\u7801\u529f\u80fd,\u5f53\u6211\u4eec\u5728\u754c\u9762\u70b9\u51fb\u201c\u83b7\u53d6\u9a8c\u8bc1\u7801\u201d\u540e,\u6211\u4eec\u8fd8\u53ef\u4ee5\u540c\u65f6\u8fdb\u884c\u5176\u4ed6\u7684\u64cd\u4f5c,\u5982\u8f93\u5165\u66f4\u65b0\u7684\u5bc6\u7801\u7b49,\u6b64\u65f6,\u6211\u4eec\u4e0d\u9700\u8981\u4e00\u76f4\u7b49\u5230\u624b\u673a\u6536\u5230\u77ed\u4fe1\u4e86\u624d\u8fdb\u884c\u4e0b\u4e00\u6b65\u7684\u64cd\u4f5c,\u8fd9\u5c31\u662f\u5f02\u6b65\u5904\u7406,\u63d0\u9ad8\u4e86\u7528\u6237\u4f53\u9a8c\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f5c\u7528\uff1a\u5f02\u6b65\u80fd\u63d0\u9ad8\u7cfb\u7edf\u7684\u54cd\u5e94\u901f\u5ea6\u3001\u541e\u5410\u91cf\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000846\" data-ratio=\"0.5683802133850631\"  data-type=\"png\" data-w=\"1031\" width=\"1031\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000846\" data-ratio=\"0.5683802133850631\"  data-type=\"png\" data-w=\"1031\" width=\"1031\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png\"  \/><\/noscript><\/p>\n<h2 data-lake-index-type=\"0\" style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span lake-read-ignore=\"true\">2. <\/span><span style=\"color: rgb(51, 51, 51);\">\u89e3\u8026<\/span><\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f8b\u5b50\uff1a<\/span><span style=\"color: rgb(25, 27, 31);\">\u5982\u5e38\u89c1\u7684\u8ba2\u5355\u7cfb\u7edf,\u5f53\u6709\u8ba2\u5355\u4e0b\u5355\u65f6,\u6211\u4eec\u9700\u8981\u51cf\u53bb\u5e93\u5b58,\u4f46\u5982\u679c\u8ba2\u5355\u3001\u5e93\u5b58\u7684\u903b\u8f91\u90fd\u653e\u5728\u4e00\u4e2a\u7cfb\u7edf\u4e2d,\u4e0d\u6b62\u5904\u7406\u4e8b\u4ef6\u9700\u8981\u5f88\u957f,\u7cfb\u7edf\u7684\u8026\u5408\u6027\u6bd4\u8f83\u9ad8,\u6b64\u65f6,\u4f7f\u7528\u6d88\u606f\u4e2d\u95f4\u4ef6,\u53ef\u4ee5\u5b9e\u73b0\u5c06\u8ba2\u5355\u4e1a\u52a1\u548c\u5e93\u5b58\u4e1a\u52a1\u62bd\u51fa\u6765\u505a\u4e0d\u540c\u7684\u7cfb\u7edf,\u6bcf\u6b21\u4e0b\u5355\u7684\u65f6\u5019\u53ef\u4ee5\u5c06\u4e0b\u5355\u4fe1\u606f\u653e\u5165\u6d88\u606f\u4e2d\u95f4\u95f4\u4e2d,\u7136\u540e\u5e93\u5b58\u7cfb\u7edf\u53bb\u8ba2\u9605\u5b83,\u53ea\u6709\u6709\u8ba2\u5355\u6570\u636e\u5c31\u8fdb\u884c\u51cf\u53bb\u5e93\u5b58\u64cd\u4f5c,\u8fd9\u6837\u5c31\u5c06\u5e94\u7528\u89e3\u8026\u4e86\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f5c\u7528\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">1\u3001\u670d\u52a1\u4e4b\u95f4\u8fdb\u884c\u89e3\u8026\uff0c\u624d\u53ef\u4ee5\u51cf\u5c11\u670d\u52a1\u4e4b\u95f4\u7684\u5f71\u54cd\u3002\u63d0\u9ad8\u7cfb\u7edf\u6574\u4f53\u7684\u7a33\u5b9a\u6027\u4ee5\u53ca\u53ef\u6269\u5c55\u6027\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">2\u3001\u53e6\u5916\uff0c\u89e3\u8026\u540e\u53ef\u4ee5\u5b9e\u73b0\u6570\u636e\u5206\u53d1\u3002\u751f\u4ea7\u8005\u53d1\u9001\u4e00\u4e2a\u6d88\u606f\u540e\uff0c\u53ef\u4ee5\u7531\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u6d88\u8d39\u8005\u8fdb\u884c\u6d88\u8d39\uff0c\u5e76\u4e14\u6d88\u8d39\u8005\u7684\u589e\u52a0\u6216\u8005\u51cf\u5c11\u5bf9\u751f\u4ea7\u8005\u6ca1\u6709\u5f71\u54cd\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000847\" data-ratio=\"0.5803571428571429\"  data-type=\"png\" data-w=\"560\" style=\"width: 526px;height: 305px;\" width=\"560\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224053891.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000847\" data-ratio=\"0.5803571428571429\"  data-type=\"png\" data-w=\"560\" style=\"width: 526px;height: 305px;\" width=\"560\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224053891.png\"><\/noscript><\/p>\n<h2 data-lake-index-type=\"0\" style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span lake-read-ignore=\"true\">3. <\/span><span style=\"color: rgb(51, 51, 51);\">\u524a\u5cf0<\/span><\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f8b\u5b50\uff1a<\/span><span style=\"color: rgb(25, 27, 31);\">\u5982\u5e38\u89c1\u7684\u79d2\u6740\u7cfb\u7edf,\u5982\u679c\u67095\u4e07\u4e2a\u5546\u54c1\u53ef\u4ee5\u79d2\u6740,\u6ca1\u6709\u6d88\u606f\u4e2d\u95f4\u4ef6\u7684\u8bdd,\u6240\u6709\u7684\u8bf7\u6c42\u90fd\u4e00\u6b21\u6027\u5230\u540e\u53f0,\u6b64\u65f6\u7cfb\u7edf\u5f88\u5bb9\u6613\u5361\u6b7b,\u5f15\u5165\u6d88\u606f\u4e2d\u95f4\u4ef6\u5982\u6d88\u606f\u961f\u5217,\u6b64\u65f6\u53ef\u4ee5\u5728\u961f\u5217\u4e2d\u8bbe\u7f6e\u597d\u53ef\u4ee5\u5b58\u50a8\u6570\u636e\u7684\u6570\u91cf,\u8fd9\u6837\u6bcf\u6b21\u7528\u6237\u8bf7\u6c42\u4f1a\u5148\u4f46\u6d88\u606f\u961f\u5217\u4e2d,\u6d88\u606f\u961f\u5217\u5c31\u51cf\u53bb1,\u5f53\u6d88\u606f\u961f\u5217\u4e2d\u5b58\u50a8\u957f\u5ea6\u4e3a0\u65f6,\u76f4\u63a5\u8fd4\u56de\u79d2\u6740\u5931\u8d25,\u8fd9\u6837\u5c31\u907f\u514d\u4e86\u6240\u6709\u7528\u6237\u8bf7\u6c42\u53ef\u80fd\u5728\u540c\u4e00\u65f6\u95f4\u5230\u8fbe\u7cfb\u7edf\u540e\u53f0,\u8fbe\u5230\u6d41\u91cf\u524a\u5cf0\u7684\u4f5c\u7528\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;margin-left: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f5c\u7528\uff1a\u4ee5\u7a33\u5b9a\u7684\u7cfb\u7edf\u8d44\u6e90\u5e94\u5bf9\u7a81\u53d1\u7684\u6d41\u91cf\u51b2\u51fb\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000845\" data-ratio=\"0.5297202797202797\"  data-type=\"png\" data-w=\"572\" width=\"572\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224057111.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000845\" data-ratio=\"0.5297202797202797\"  data-type=\"png\" data-w=\"572\" width=\"572\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224057111.png\"  \/><\/noscript><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">2.RibbitMQ<\/h1>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">2.1\u7b80\u4ecb<\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\">RabbitMQ \u662f\u4f7f\u7528 Erlang \u8bed\u8a00\u5f00\u53d1\u7684\u5f00\u6e90\u6d88\u606f\u961f\u5217\u7cfb\u7edf\uff0c\u57fa\u4e8e AMQP \u534f\u8bae\u6765\u5b9e\u73b0\u3002AMQP \u7684\u4e3b\u8981\u7279 \u5f81\u662f\u9762\u5411\u6d88\u606f\u3001\u961f\u5217\u3001\u8def\u7531\uff08\u5305\u62ec\u70b9\u5bf9\u70b9\u548c\u53d1\u5e03\/\u8ba2\u9605\uff09\u3001\u53ef\u9760\u6027\u3001\u5b89\u5168\u3002AMQP \u534f\u8bae\u66f4\u591a\u7528\u5728\u4f01\u4e1a \u7cfb\u7edf\u5185\uff0c\u5bf9\u6570\u636e\u4e00\u81f4\u6027\u3001\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u8981\u6c42\u5f88\u9ad8\u7684\u573a\u666f\uff0c\u5bf9\u6027\u80fd\u548c\u541e\u5410\u91cf\u7684\u8981\u6c42\u8fd8\u5728\u5176\u6b21\u3002 <\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">2.2\u6269\u5c55<\/h2>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">2.2.1\u534f\u8bae<\/h3>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">\u4ec0\u4e48\u662f\u534f\u8bae<\/h4>\n<p style=\"min-height: 24px;\">\u534f\u8bae\uff1a\u662f\u5728TCP\/IP\u534f\u8bae\u57fa\u7840\u4e4b\u4e0a\u6784\u5efa\u7684\u79cd\u7ea6\u5b9a\u6210\u7684\u89c4\u8303\u548c\u673a\u5236\uff0c\u76ee\u7684\u662f\u8ba9\u5ba2\u6237\u7aef\u8fdb\u884c\u6c9f\u901a\u548c\u901a\u8baf\u3002\u5e76\u4e14\u8fd9\u79cd\u534f\u8bae\u4e0b\u89c4\u8303\u5fc5\u987b\u5177\u6709\u6301\u4e45\u6027\uff0c\u9ad8\u53ef\u7528\uff0c\u9ad8\u53ef\u9760\u7684\u6027\u80fd\u3002<\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u91c7\u7528TCP\/IP\u534f\u8bae\u53bb\u4f20\u9012\u6d88\u606f\uff1f<\/h4>\n<p style=\"min-height: 24px;text-indent: 2em;\">\u56e0\u4e3aTCP\/IP\u534f\u8bae\u592a\u8fc7\u4e8e\u7b80\u5355\uff0c\u5e76\u4e0d\u80fd\u627f\u8f7d\u6d88\u606f\u7684\u5185\u5bb9\u548c\u8f7d\u4f53\uff0c\u56e0\u6b64\u5728\u6b64\u4e4b\u4e0a\u589e\u52a0\u4e00\u4e9b\u5185\u5bb9\uff0c\u7ed9\u6d88\u606f\u7684\u4f20\u9012\u5206\u53d1\u9ad8\u53ef\u7528\u63d0\u4f9b\u57fa\u7840\u3002<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000843\" data-ratio=\"1.1153846153846154\"  data-type=\"png\" data-w=\"312\" width=\"312\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224101838.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000843\" data-ratio=\"1.1153846153846154\"  data-type=\"png\" data-w=\"312\" width=\"312\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224101838.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u6d88\u606f\u4e2d\u95f4\u4ef6\u8d1f\u8d23\u6570\u636e\u7684\u4f20\u9012\uff0c\u5b58\u50a8\uff0c\u548c\u5206\u53d1\u6d88\u8d39\u4e09\u4e2a\u90e8\u5206\uff0c\u6570\u636e\u7684\u5b58\u50a8\u548c\u5206\u53d1\u7684\u8fc7\u7a0b\u4e2d\u80af\u5b9a\u8981\u9075\u5faa\u67d0\u79cd\u7ea6\u5b9a\u6210\u4fd7\u7684\u89c4\u8303\uff0c\u662f\u91c7\u7528\u5e95\u5c42\u7684TCP\/IP\uff0cUDP\u534f\u8bae\u8fd8\u662f\u5728\u8fd9\u57fa\u7840\u4e0a\u81ea\u5df1\u6784\u5efa\u7b49\uff0c\u800c\u8fd9\u4e9b\u7ea6\u5b9a\u6210\u4fd7\u7684\u89c4\u8303\u5c31\u79f0\u4e4b\u4e3a\uff1a\u534f\u8bae\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(85, 86, 102);font-size: 16px;\">\u6240\u8c13\u534f\u8bae\u662f\u6307\uff1a<\/span><\/p>\n<ol class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.5);font-size: 14px;\">\u8ba1\u7b97\u673a\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u548c\u5e94\u7528\u7a0b\u5e8f\u901a\u8baf\u65f6\u5171\u540c\u9075\u5b88\u7684\u7ec4\u7ea6\u5b9a\uff0c\u53ea\u6709\u9075\u5faa\u5171\u540c\u7684\u7ea6\u5b9a\u548c\u89c4\u8303\uff0c\u7cfb\u7edf\u548c\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u95f4\u624d\u80fd\u76f8\u4e92\u4ea4\u6d41\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.5);font-size: 14px;\">\u548c\u4e00\u822c\u7684\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\u7684\u4e0d\u540c\uff0c\u5b83\u4e3b\u8981\u8d1f\u8d23\u6570\u636e\u7684\u63a5\u53d7\u548c\u4f20\u9012\uff0c\u6240\u4ee5\u6027\u80fd\u6bd4\u8f83\u7684\u9ad8\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.5);font-size: 14px;\">\u534f\u8bae\u5bf9\u6570\u636e\u683c\u5f0f\u548c\u8ba1\u7b97\u673a\u4e4b\u95f4\u4ea4\u6362\u6570\u636e\u90fd\u5fc5\u987b\u4e25\u683c\u9075\u5b88\u89c4\u8303\u3002<\/span><\/p>\n<\/li>\n<\/ol>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(79, 79, 79);\">\u7f51\u7edc\u534f\u8bae\u7684\u4e09\u8981\u7d20<\/span><\/h4>\n<ol class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u8bed\u6cd5<\/span><\/strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\uff1a\u8bed\u6cd5\u662f\u7528\u6237\u6570\u636e\u4e0e\u63a7\u5236\u4fe1\u606f\u7684\u7ed3\u6784\u4e0e\u683c\u5f0f\uff0c\u4ee5\u53ca\u6570\u636e\u51fa\u73b0\u7684\u987a\u5e8f\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u8bed\u4e49<\/span><\/strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\uff1a\u8bed\u4e49\u662f\u89e3\u63a7\u5236\u4fe1\u606f\u6bcf\u4e2a\u90e8\u5206\u7684\u610f\u4e49\u3002\u5b83\u89c4\u5b9a\u4e86\u9700\u8981\u53d1\u51fa\u4f55\u79cd\u63a7\u5236\u4fe1\u606f\u4ee5\u53ca\u5b8c\u6210\u7684\u52a8\u4f5c\u4e0e\u505a\u51fa\u4ec0\u4e48\u6837\u7684\u54cd\u5e94\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u65f6\u5e8f<\/span><\/strong><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\uff1a\u65f6\u5e8f\u662f\u5bf9\u4e8b\u4ef6\u53d1\u751f\u987a\u5e8f\u7684\u8be6\u7ec6\u8bf4\u660e\u3002<\/span><\/p>\n<\/li>\n<\/ol>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgba(0, 0, 0, 0.75);\">\u7c7b\u6bd4http\u8bf7\u6c42\u534f\u8bae<\/span><\/h5>\n<ol class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u8bed\u6cd5\uff1ahttp\u89c4\u5b9a\u4e86\u8bf7\u6c42\u62a5\u6587\u548c\u54cd\u5e94\u62a5\u6587\u7684\u683c\u5f0f<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u8bed\u4e49\uff1a\u5ba2\u6237\u7aef\u4e3b\u52a8\u53d1\u8d77\u8bf7\u6c42\u79f0\u4e4b\u4e3a\u8bf7\u6c42\u3002\uff08\u8fd9\u662f\u4e00\u79cd\u5b9a\u4e49\uff0c\u540c\u65f6\u4f60\u53d1\u8d77\u7684\u662fpost\/get\u8bf7\u6c42\uff09<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgba(0, 0, 0, 0.75);font-size: 16px;\">\u65f6\u5e8f\uff1a\u4e00\u4e2a\u8bf7\u6c42\u5bf9\u5e94\u4e2a\u54cd\u5e94\u3002\uff08\u4e00\u5b9a\u5148\u6709\u8bf7\u6c42\u5728\u6709\u54cd\u5e94\uff0c\u8fd9\u4e2a\u662f\u65f6\u5e8f\uff09<\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"min-height: 24px;\">\u800c\u6d88\u606f\u4e2d\u95f4\u4ef6\u91c7\u7528\u7684\u5e76\u4e0d\u662fhttp\u534f\u8bae\uff0c\u800c\u5e38\u89c1\u7684\u6d88\u606f\u4e2d\u95f4\u4ef6\u534f\u8bae\u6709\uff1aOpenWire\u3001AMQP\u3001MQTT\u3001Kafka\u3001OpenMessage\u534f\u8bae<\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">\u9762\u8bd5\u9898\uff1a\u4e3a\u4ec0\u4e48\u6d88\u606f\u4e2d\u95f4\u4ef6\u4e0d\u76f4\u63a5\u4f7f\u7528http\u534f\u8bae\u5462\uff1f<\/h4>\n<p style=\"min-height: 24px;text-indent: 2em;\">\u56e0\u4e3ahttp\u8bf7\u6c42\u62a5\u6587\u5934\u548c\u54cd\u5e94\u62a5\u6587\u5934\u662f\u6bd4\u8f83\u590d\u6742\u7684\uff0c\u5305\u542b\u4e86cookie\u3001\u6570\u636e\u7684\u52a0\u5bc6\u89e3\u5bc6\u3001\u72b6\u6001\u7801\u3001\u664c\u5e94\u7801\u7b49\u9644\u52a0\u7684\u529f\u80fd\uff0c\u4f46\u662f\u5bf9\u4e8e\u4e2a\u6d88\u606f\u800c\u8a00\uff0c\u6211\u4eec\u5e76\u4e0d\u9700\u8981\u8fd9\u4e48\u590d\u6742\uff0c\u4e5f\u6ca1\u6709\u8fd9\u4e2a\u5fc5\u8981\u6027\uff0c\u5b83\u5176\u5b9e\u5c31\u662f\u8d1f\u8d23\u6570\u636e\u4f20\u9012\uff0c\u5b58\u50a8\uff0c\u5206\u53d1\u5c31\u591f\uff0c\u8981\u8ffd\u6c42\u7684\u662f\u9ad8\u6027\u80fd\u3002\u5c3d\u91cf\u7b80\u6d01\uff0c\u5feb\u901f\u3002<\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\">\u5927\u90e8\u5206\u60c5\u51b5\u4e0bhttp\u5927\u90e8\u5206\u90fd\u662f\u77ed\u94fe\u63a5\uff0c\u5728\u5b9e\u9645\u7684\u4ea4\u4e92\u8fc7\u7a0b\u4e2d\uff0c\u4e00\u4e2a\u8bf7\u6c42\u5230\u54cd\u5e94\u5f88\u6709\u53ef\u80fd\u4f1a\u4e2d\u65ad\uff0c\u4e2d\u65ad\u4ee5\u540e\u5c31\u4e0d\u4f1a\u5c31\u884c\u6301\u4e45\u5316\uff0c\u5c31\u4f1a\u9020\u6210\u8bf7\u6c42\u7684\u4e22\u5931\u3002\u8fd9\u6837\u5c31\u4e0d\u5229\u4e8e\u6d88\u606f\u4e2d\u95f4\u4ef6\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u56e0\u4e3a\u6d88\u606f\u4e2d\u95f4\u4ef6\u53ef\u80fd\u662f\u4e00\u4e2a\u957f\u671f\u7684\u83b7\u53d6\u6d88\u606f\u7684\u8fc7\u7a0b\uff0c\u51fa\u73b0\u95ee\u9898\u548c\u6545\u969c\u8981\u5bf9\u6570\u636e\u6216\u6d88\u606f\u5c31\u884c\u6301\u4e45\u5316\u7b49\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u4fdd\u8bc1\u6d88\u606f\u548c\u6570\u636e\u7684\u9ad8\u53ef\u9760\u548c\u7a33\u5065\u7684\u8fd0\u884c\u3002<\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(79, 79, 79);\">\u5e38\u7528\u6d88\u606f\u4e2d\u95f4\u4ef6\u534f\u8bae<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: #DF2A3F;\">AMQP<\/span>\u534f\u8bae\uff08Advanced Message Queuing Protocol\u2014\u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae\uff09<\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\">\u5b83\u7531\u6469\u6839\u5927\u901a\u96c6\u56e2\u8054\u5408\u5176\u4ed6\u516c\u53f8\u5171\u540c\u8bbe\u8ba1\u3002\u662f\u4e00\u4e2a\u63d0\u4f9b\u7edf\u4e00\u6d88\u606f\u670d\u52a1\u7684\u5e94\u7528\u5c42\u6807\u51c6\u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae\uff0c\u662f\u5e94\u7528\u5c42\u534f\u8bae\u7684\u4e00\u4e2a\u5f00\u653e\u6807\u51c6\uff0c\u4e3a\u9762\u5411\u6d88\u606f\u7684\u4e2d\u95f4\u4ef6\u8bbe\u8ba1\u3002\u57fa\u4e8e\u6b64\u534f\u8bae\u7684\u5ba2\u6237\u7aef\u4e0e\u6d88\u606f\u4e2d\u95f4\u4ef6\u53ef\u4f20\u9012\u6d88\u606f\uff0c\u5e76\u4e0d\u53d7\u5ba2\u6237\u7aef\/\u4e2d\u95f4\u4ef6\u4e0d\u540c\u4ea7\u54c1\uff0c\u4e0d\u540c\u7684\u5f00\u53d1\u8bed\u8a00\u7b49\u6761\u4ef6\u7684\u9650\u5236\u3002<\/p>\n<p style=\"min-height: 24px;text-align: left;\"><strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u7279\u6027<\/span><\/strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u652f\u3001\u6d88\u606f\u7684\u6301\u4e45\u5316\u652f\u6301\u3001\u9ad8\u6027\u80fd\u548c\u9ad8\u53ef\u9760\u7684\u6d88\u606f\u5904\u7406\u4f18\u52bf<\/span><\/p>\n<p style=\"min-height: 24px;text-align: left;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">AMQP\u5178\u578b\u7684\u5b9e\u73b0\u8005\u662f<\/span><span style=\"color: rgb(199, 37, 78);background-color: rgb(249, 242, 244);font-size: 14px;\">RabbitMQ<\/span><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u3001<\/span><span style=\"color: rgb(199, 37, 78);background-color: rgb(249, 242, 244);font-size: 14px;\">ACTIVEMQ<\/span><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u7b49\uff0c\u5176\u4e2d<\/span><span style=\"color: rgb(199, 37, 78);background-color: rgb(249, 242, 244);font-size: 14px;\">RabbitMQ<\/span><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u7531<\/span><span style=\"color: rgb(199, 37, 78);background-color: rgb(249, 242, 244);font-size: 14px;\">Erlang<\/span><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u5f00\u53d1<\/span><\/p>\n<p style=\"min-height: 24px;text-align: left;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000844\" data-ratio=\"0.17760180995475114\"  data-type=\"png\" data-w=\"884\" width=\"884\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224105790.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000844\" data-ratio=\"0.17760180995475114\"  data-type=\"png\" data-w=\"884\" width=\"884\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224105790.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-align: left;\"><span style=\"color: #DF2A3F;\">MQTT<\/span>\u534f\u8bae\uff08Message Queueing Telemetry Transport\u2014\u6d88\u606f\u961f\u5217\u9065\u6d4b\u4f20\u8f93\u534f\u8bae\uff09<\/p>\n<p style=\"min-height: 24px;\">\u5b83\u662f\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\uff08publish\/subscribe\uff09\u6a21\u5f0f\u7684\"\u8f7b\u91cf\u7ea7\"\u901a\u8baf\u534f\u8bae\uff0c\u8be5\u534f\u8bae\u6784\u5efa\u4e8eTCP\/IP\u534f\u8bae\u4e0a\uff0c\u7531IBM\u57281999\u5e74\u53d1\u5e03\u3002<\/p>\n<p style=\"min-height: 24px;\">\u7279\u70b9\uff1a\u8f7b\u91cf\u3001\u7ed3\u6784\u7b80\u5355\u3001\u4f20\u8f93\u5feb\u3001\u4e0d\u652f\u6301\u4e8b\u52a1\u3001\u6ca1\u6709\u6301\u4e45\u5316\u8bbe\u8ba1<\/p>\n<p style=\"min-height: 24px;\">\u5e94\u7528\u573a\u666f\uff1a\u9002\u7528\u4e8e\u8ba1\u7b97\u80fd\u529b\u6709\u9650\u3001\u4f4e\u5e26\u5bbd\u3001\u7f51\u7edc\u4e0d\u7a33\u5b9a\u7684\u573a\u666f<\/p>\n<p style=\"min-height: 24px;\">\u652f\u6301\u8005\uff1aRabbitMQ\u3001ACTIVEMQ\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5173\u95ed\uff0c\u9700\u8981\u6253\u5f00\uff09<\/p>\n<p style=\"min-height: 24px;text-align: left;\"><span style=\"color: rgb(199, 37, 78);background-color: rgb(249, 242, 244);font-size: 14px;\">kafka<\/span><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u534f\u8bae<\/span><\/p>\n<p style=\"min-height: 24px;text-align: left;\">\u57fa\u4e8eTCP\/IP\u7684\u4e8c\u8fdb\u5236\u534f\u8bae\u3002\u6d88\u606f\u5185\u90e8\u662f\u901a\u8fc7\u957f\u5ea6\u6765\u5206\u5272\uff0c\u7531\u4e9b\u57fa\u672c\u6570\u636e\u7c7b\u578b\u7ec4\u6210\u3002<\/p>\n<p style=\"min-height: 24px;text-align: left;\"><strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u7279\u70b9<\/span><\/strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\uff1a\u7ed3\u6784\u7b80\u5355\u3001\u89e3\u6790\u901f\u5ea6\u5feb\u3001\u65e0\u4e8b\u52a1\u652f\u6301\u3001\u6709\u6301\u4e45\u5316\u8bbe\u8ba1<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(79, 79, 79);\">2.3\u6d88\u606f\u961f\u5217\u6301\u4e45\u5316<\/span><\/h2>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u6301\u4e45\u5316\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u5c06\u6570\u636e\u5b58\u5165\u78c1\u76d8\uff0c\u800c\u4e0d\u662f\u5b58\u5728\u5185\u5b58\u4e2d\u968f\u670d\u52a1\u5668\u91cd\u542f\u65ad\u5f00\u800c\u6d88\u5931\uff0c\u4f7f\u6570\u636e\u80fd\u591f\u6c38\u4e45\u4fdd\u5b58\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000850\" data-ratio=\"0.5228377065111759\"  data-type=\"png\" data-w=\"1029\" width=\"1029\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109493.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000850\" data-ratio=\"0.5228377065111759\"  data-type=\"png\" data-w=\"1029\" width=\"1029\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109493.png\"><\/noscript><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">\u5e38\u89c1\u7684\u6301\u4e45\u5316\u65b9\u5f0f\u548c\u5bf9\u6bd4\uff1a<\/span><\/h4>\n<table width=\"750\">\n<tbody>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\"><\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">ActiveMQ<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">RabbitMQ<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">Kafka<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">RocketMQ<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u6587\u4ef6\u5b58\u50a8<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u6570\u636e\u5e93<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(79, 79, 79);\">2.4\u6d88\u606f\u7684\u5206\u53d1\u7b56\u7565<\/span><\/h2>\n<p style=\"min-height: 24px;\">MQ\u6d88\u606f\u961f\u5217\u6709\u5982\u4e0b\u51e0\u4e2a\u89d2\u8272\uff1a<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000848\" data-ratio=\"0.14538558786346398\"  data-type=\"png\" data-w=\"791\" width=\"791\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224115418.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000848\" data-ratio=\"0.14538558786346398\"  data-type=\"png\" data-w=\"791\" width=\"791\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224115418.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\">Producer\uff1a\u6d88\u606f\u751f\u4ea7\u8005\u3002\u8d1f\u8d23\u4ea7\u751f\u548c\u53d1\u9001\u6d88\u606f\u5230 Broker<\/p>\n<p style=\"min-height: 24px;\">Broker\uff1a\u6d88\u606f\u5904\u7406\u4e2d\u5fc3\u3002\u8d1f\u8d23\u6d88\u606f\u5b58\u50a8\u3001\u786e\u8ba4\u3001\u91cd\u8bd5\u7b49\uff0c\u4e00\u822c\u5176\u4e2d\u4f1a\u5305\u542b\u591a\u4e2a queue<\/p>\n<p style=\"min-height: 24px;\">Consumer\uff1a\u6d88\u606f\u6d88\u8d39\u8005\u3002\u8d1f\u8d23\u4ece Broker \u4e2d\u83b7\u53d6\u6d88\u606f\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u5904\u7406<\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">2.4.1\u751f\u4ea7\u8005\u4ea7\u751f\u6d88\u606f\u540e\uff0cMQ\u8fdb\u884c\u5b58\u50a8\uff0c\u6d88\u8d39\u8005\u5982\u4f55\u83b7\u5f97\u6d88\u606f\u5462\uff1f<\/h4>\n<p style=\"min-height: 24px;\">\u4e00\u822c\u7684\u83b7\u53d6\u65b9\u5f0f\u65e0\u5916\u4e4e\u5916\u63a8\uff08push\uff09\u6216\u8005\uff08pull\uff09\u4e24\u79cd\u65b9\u5f0f\uff0c\u5178\u578b\u7684git\u5c31\u6709\u63a8\u62c9\u673a\u5236\uff0c\u6211\u4eec\u53d1\u9001\u7684http\u8bf7\u6c42\u5c31\u662f\u4e00\u79cd\u5178\u578b\u7684\u62c9\u53d6\u6570\u636e\u5e93\u6570\u636e\u8fd4\u56de\u7684\u8fc7\u7a0b\u3002\u800c\u6d88\u606f\u961f\u5217MQ\u662f\u4e00\u79cd\u63a8\u9001\u8fc7\u7a0b\uff0c\u800c\u8fd9\u4e9b\u63a8\u673a\u5236\u4f1a\u9002\u7528\u5230\u5f88\u591a\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u4e5f\u6709\u5f88\u591a\u5bf9\u5e94\u7684\u63a8\u673a\u5236\u7b56\u7565<\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\">\u573a\u666f\u5206\u6790\u4e00<\/h5>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000851\" data-ratio=\"0.4681933842239186\"  data-type=\"png\" data-w=\"786\" width=\"786\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224118630.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000851\" data-ratio=\"0.4681933842239186\"  data-type=\"png\" data-w=\"786\" width=\"786\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224118630.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u6bd4\u5982\u6211\u5728APP\u4e0a\u4e0b\u4e86\u4e00\u4e2a\u8ba2\u5355\uff0c\u6211\u4eec\u7684\u7cfb\u7edf\u548c\u670d\u52a1\u5f88\u591a\uff0c\u6211\u4eec\u5982\u4f55\u5f97\u77e5\u8fd9\u4e2a\u6d88\u606f\u88ab\u90a3\u4e2a\u7cfb\u7edf\u6216\u8005\u90a3\u4e9b\u670d\u52a1\u6216\u8005\u7cfb\u7edf\u8fdb\u884c\u6d88\u8d39\uff0c\u6b64\u65f6\u5c31\u9700\u8981\u4e00\u4e2a<\/span><strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u6d88\u8d39\u7b56\u7565<\/span><\/strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\uff0c\u6216\u79f0\u4e3a\u6d88\u8d39\u7684\u65b9\u6cd5\u8bba\u3002<\/span><\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">\u573a\u666f\u5206\u6790\u4e8c<\/span><\/h5>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000849\" data-ratio=\"0.3279503105590062\"  data-type=\"png\" data-w=\"805\" width=\"805\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224121866.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000849\" data-ratio=\"0.3279503105590062\"  data-type=\"png\" data-w=\"805\" width=\"805\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224121866.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u5728\u53d1\u9001\u6d88\u606f\u7684\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u51fa\u73b0\u5f02\u5e38\uff0c\u6216\u8005\u7f51\u7edc\u7684\u6296\u52a8\uff0c\u6545\u969c\u7b49\u7b49\u56e0\u4e3a\u9020\u6210\u6d88\u606f\u7684\u65e0\u6cd5\u6d88\u8d39\uff0c\u6bd4\u5982\u7528\u6237\u5728\u4e0b\u8ba2\u5355\uff0c\u6d88\u8d39MQ\u63a5\u53d7\uff0c\u8ba2\u5355\u7cfb\u7edf\u51fa\u73b0\u6545\u969c\uff0c\u5bfc\u81f4\u7528\u6237\u652f\u4ed8\u5931\u8d25\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u6d88\u606f\u4e2d\u95f4\u4ef6\u5c31\u5fc5\u987b\u652f\u6301<\/span><strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u6d88\u606f\u91cd\u8bd5\u673a\u5236\u7b56\u7565<\/span><\/strong><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u3002\u4e5f\u5c31\u662f\u652f\u6301\uff1a\u51fa\u73b0\u95ee\u9898\u548c\u6545\u969c\u7684\u60c5\u51b5\u4e0b\uff0c\u6d88\u606f\u4e0d\u4e22\u5931\u8fd8\u53ef\u4ee5\u8fdb\u884c\u91cd\u53d1<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">2.4.2\u6d88\u606f\u5206\u53d1\u7b56\u7565\u7684\u673a\u5236\u548c\u5bf9\u6bd4<\/span><\/h4>\n<table width=\"750\">\n<tbody>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\"><\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">ActiveMQ<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">RabbitMQ<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">Kafka<\/span><\/strong><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(239, 243, 245);\">\n<p style=\"min-height: 24px;text-align: center;\"><strong><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">RocketMQ<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u53d1\u5e03\u8ba2\u9605<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u8f6e\u8be2\u5206\u53d1<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u516c\u5e73\u5206\u53d1<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u91cd\u53d1<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);background-color: rgb(247, 247, 247);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 33px;\">\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u6d88\u606f\u62c9\u53d6<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\/<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<td width=\"150\" style=\"border-color: rgb(217, 217, 217);\">\n<p style=\"min-height: 24px;text-align: center;\"><span style=\"color: rgb(79, 79, 79);font-size: 14px;\">\u652f\u6301<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\"><span style=\"color: rgb(51, 51, 51);\">3\u3001MQ\u7684\u4f18\u7f3a\u70b9<\/span><\/h1>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4e0a\u9762MQ\u7684\u6240\u7528\u4e5f\u5c31\u662f\u4f7f\u7528MQ\u7684\u4f18\u70b9\u3002 \u4f46\u662f\u5f15\u5165MQ\u4e5f\u662f\u6709\u4ed6\u7684\u7f3a\u70b9\u7684\uff1a<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7cfb\u7edf\u53ef\u7528\u6027\u964d\u4f4e<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7cfb\u7edf\u5f15\u5165\u7684\u5916\u90e8\u4f9d\u8d56\u589e\u591a\uff0c\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u5c31\u4f1a\u53d8\u5dee\u3002\u4e00\u65e6MQ\u5b95\u673a\uff0c\u5bf9\u4e1a\u52a1\u4f1a\u4ea7\u751f\u5f71\u54cd\u3002\u8fd9\u5c31\u9700\u8981\u8003\u8651\u5982\u4f55\u4fdd\u8bc1MQ\u7684\u9ad8\u53ef\u7528\u3002<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7cfb\u7edf\u590d\u6742\u5ea6\u63d0\u9ad8<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5f15\u5165MQ\u540e\u7cfb\u7edf\u7684\u590d\u6742\u5ea6\u4f1a\u5927\u5927\u63d0\u9ad8\u3002\u4ee5\u524d\u670d\u52a1\u4e4b\u95f4\u53ef\u4ee5\u8fdb\u884c\u540c\u6b65\u7684\u670d\u52a1\u8c03\u7528\uff0c\u5f15\u5165MQ\u540e\uff0c\u4f1a\u53d8\u4e3a\u5f02\u6b65\u8c03\u7528\uff0c\u6570\u636e\u7684\u94fe\u8def\u5c31\u4f1a\u53d8\u5f97\u66f4\u590d\u6742\u3002\u5e76\u4e14\u8fd8\u4f1a\u5e26\u6765\u5176\u4ed6\u4e00\u4e9b\u95ee\u9898\u3002\u6bd4\u5982\uff1a\u5982\u4f55\u4fdd\u8bc1\u6d88\u8d39\u4e0d\u4f1a\u4e22\u5931\uff1f\u4e0d\u4f1a\u88ab\u91cd\u590d\u8c03\u7528\uff1f\u600e\u4e48\u4fdd\u8bc1\u6d88\u606f\u7684\u987a\u5e8f\u6027\u7b49\u95ee\u9898\u3002<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6d88\u606f\u4e00\u81f4\u6027\u95ee\u9898<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">A\u7cfb\u7edf\u5904\u7406\u5b8c\u4e1a\u52a1\uff0c\u901a\u8fc7MQ\u53d1\u9001\u6d88\u606f\u7ed9B\u3001C\u7cfb\u7edf\u8fdb\u884c\u540e\u7eed\u7684\u4e1a\u52a1\u5904\u7406\u3002\u5982\u679cB\u7cfb\u7edf\u5904\u7406\u6210\u529f\uff0cC\u7cfb\u7edf\u5904\u7406\u5931\u8d25\u600e\u4e48\u529e\uff1f\u8fd9\u5c31\u9700\u8981\u8003\u8651\u5982\u4f55\u4fdd\u8bc1\u6d88\u606f\u6570\u636e\u5904\u7406\u7684\u4e00\u81f4\u6027\u3002<\/span><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\"><span style=\"color: rgb(51, 51, 51);\">4\u3001\u51e0\u5927MQ\u4ea7\u54c1\u7279\u70b9\u6bd4\u8f83<\/span><\/h1>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5e38\u7528\u7684MQ\u4ea7\u54c1\u5305\u62ecKafka\u3001RabbitMQ\u548cRocketMQ\u3002\u6211\u4eec\u5bf9\u8fd9\u4e09\u4e2a\u4ea7\u54c1\u505a\u4e0b\u7b80\u5355\u7684\u6bd4\u8f83\uff0c\u91cd\u70b9\u9700\u8981\u7406\u89e3\u4ed6\u4eec\u7684\u9002\u7528\u573a\u666f\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000852\" data-ratio=\"0.49339622641509434\"  data-type=\"png\" data-w=\"1060\" style=\"color: rgb(51, 51, 51);font-size: 14px;\" width=\"1060\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224123780.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000852\" data-ratio=\"0.49339622641509434\"  data-type=\"png\" data-w=\"1060\" style=\"color: rgb(51, 51, 51);font-size: 14px;\" width=\"1060\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224123780.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u53e6\u5916\uff0c\u5173\u4e8e\u8fd9\u4e09\u5927\u4ea7\u54c1\u66f4\u8be6\u7ec6\u7684\u6bd4\u8f83\uff0c\u53ef\u4ee5\u53c2\u89c1\u300akafka vs rabbitmq vs rocketmq.pdf\u300b<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5173\u4e8eRabbitMQ\u7684\u529f\u80fd\u7279\u6027\uff0c\u53ef\u4ee5\u5728\u5b98\u7f51( <\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">https:\/\/www.rabbitmq.com\/<\/span><span style=\"color: rgb(119, 119, 119);font-size: 14px;\"> )\u4e0a\u770b\u5230\uff0c\u5305\u542b Asynchronous Message(\u5f02\u6b65\u6d88\u606f)\u3001Developer Experience(\u5f00\u53d1\u4f53\u9a8c)\u3001Distributed Deployment(\u5206\u5e03\u5f0f\u90e8\u7f72)\u3001Enterprise &amp; Cloud Ready(\u4f01\u4e1a\u4e91\u90e8\u7f72)\u3001Tools &amp; Plugins(\u5de5\u5177\u548c\u63d2\u4ef6)\u3001Management &amp; Monitoring(\u7ba1\u7406\u548c\u76d1\u63a7)\u516d\u5927\u90e8\u5206\u3002\u6240\u4ee5\u5176\u4e2d\u7684\u529f\u80fd\u662f\u76f8\u5f53\u4e30\u5bcc\u7684\uff0c\u800c\u6211\u4eec\u80af\u5b9a\u53ea\u80fd\u5173\u6ce8\u91cd\u70b9\u7684\u90e8\u5206\u5185\u5bb9\uff0c\u6240\u4ee5\u8fd8\u662f\u8981\u7ecf\u5e38\u5230\u5b98\u7f51\u4e0a\u53bb\u770b\u770b\u7684\u3002<\/span>\ud83d\udccekafka vs rabbitmq vs rocketmq.pdf<\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">5.Windows\u5b89\u88c5RibbitMQ<\/h1>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.1.<span style=\"color: rgb(77, 77, 77);\">\u5148\u5b89\u88c5otp_win64_24.1.7.exe<\/span><\/h2>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">5.2.\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c<\/span><\/h2>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">5.3.\u63a5\u7740\u9009\u53d6\u8981\u5b89\u88c5\u7684\u8def\u5f84\uff0c\u7136\u540e\u4e00\u8def\u50bb\u74dc\u5f0f\u5b89\u88c5 next \u4e0b\u4e00\u6b65\uff0c\u5b89\u88c5\u5373\u53ef\u3002<\/span><\/h2>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(77, 77, 77);font-size: 16px;\">\u3010\u6ce8\u610f\u3011\u4e0d\u8981\u5b89\u88c5\u5728\u4e2d\u6587\u6216\u5e26\u7a7a\u683c\u7684\u6587\u4ef6\u8def\u5f84\u4e0b<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(77, 77, 77);\">5.4.\u627e\u5230\u521a\u521a\u5b89\u88c5\u7684\u6587\u4ef6\u5939<\/span><\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000857\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224128981.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000857\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224128981.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.5.\u914d\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000856\" data-ratio=\"1.0537974683544304\"  data-type=\"png\" data-w=\"632\" width=\"632\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224133133.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000856\" data-ratio=\"1.0537974683544304\"  data-type=\"png\" data-w=\"632\" width=\"632\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224133133.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000855\" data-ratio=\"1.0723809523809524\"  data-type=\"png\" data-w=\"525\" width=\"525\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224136528.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000855\" data-ratio=\"1.0723809523809524\"  data-type=\"png\" data-w=\"525\" width=\"525\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224136528.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.6.\u73af\u5883\u68c0\u67e5<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000853\" data-ratio=\"0.24516129032258063\"  data-type=\"png\" data-w=\"620\" width=\"620\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224139592.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000853\" data-ratio=\"0.24516129032258063\"  data-type=\"png\" data-w=\"620\" width=\"620\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224139592.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.7.\u5b89\u88c5ribbitMQ<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000854\" data-ratio=\"0.7753479125248509\"  data-type=\"png\" data-w=\"503\" width=\"503\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224141934.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000854\" data-ratio=\"0.7753479125248509\"  data-type=\"png\" data-w=\"503\" width=\"503\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224141934.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000858\" data-ratio=\"0.7753479125248509\"  data-type=\"png\" data-w=\"503\" width=\"503\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224144572.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000858\" data-ratio=\"0.7753479125248509\"  data-type=\"png\" data-w=\"503\" width=\"503\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224144572.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\">\u4e00\u8defnext\u5c31\u884c<\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: #DF2A3F;\">\u6ce8\u610f: \u5b89\u88c5\u8def\u5f84\u5c3d\u91cf\u4e0d\u8981\u5305\u542b\u4e2d\u6587\u6216\u8005\u7a7a\u683c<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.8.\u627e\u5230\u521a\u521a\u5b89\u88c5\u7684\u6587\u4ef6\u5939,\u8fdb\u5165\u5230sbin\u76ee\u5f55<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000860\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224147654.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000860\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224147654.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.9.\u8f93\u5165cmd\u8fdb\u5165cmd\u7a97\u53e3<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000861\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224152942.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000861\" data-ratio=\"0.5648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1336\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224152942.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">5.10.\u542f\u7528\u7ba1\u7406\u63d2\u4ef6<\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000862\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224157291.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000862\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224157291.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\">5.11.\u542f\u52a8rabbitMQ\u670d\u52a1<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000859\" data-ratio=\"0.5879629629629629\"  data-type=\"png\" data-w=\"1080\" width=\"1081\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224202366.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000859\" data-ratio=\"0.5879629629629629\"  data-type=\"png\" data-w=\"1080\" width=\"1081\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224202366.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\">5.12.\u8bbf\u95ee<\/p>\n<p style=\"min-height: 24px;\">\u8bbf\u95eehttp:\/\/localhost:15672\uff0c\u7528\u6237\u540d\uff1aguest, \u5bc6\u7801\uff1aguest<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000866\" data-ratio=\"0.5481481481481482\"  data-type=\"png\" data-w=\"1080\" width=\"1903\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224207511.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000866\" data-ratio=\"0.5481481481481482\"  data-type=\"png\" data-w=\"1080\" width=\"1903\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224207511.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000867\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224210173.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000867\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224210173.png\"  \/><\/noscript><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">6.Linux\u73af\u5883\u5b89\u88c5RibbitMQ<\/h1>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.1.\u5b89\u88c5 Erlang \u8bed\u8a00\u5305\u5e76\u68c0\u67e5<\/h2>\n<p style=\"min-height: 24px;\">rpm -ivh erlang-23.2.7-1.el7.x86_64.rpm<\/p>\n<p style=\"min-height: 24px;\">erl -version<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000865\" data-ratio=\"0.36203703703703705\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224214401.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000865\" data-ratio=\"0.36203703703703705\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224214401.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.2.\u5b89\u88c5RibbitMQ<\/h2>\n<p style=\"min-height: 24px;\">rpm -Uvh rabbitmq-server-3.9.15-1.el7.noarch.rpm<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000864\" data-ratio=\"0.2601851851851852\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224221409.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000864\" data-ratio=\"0.2601851851851852\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224221409.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.3.\u542f\u52a8\u5e76\u67e5\u770bmq\u5b89\u88c5\u60c5\u51b5<\/h2>\n<p style=\"min-height: 24px;\">whereis rabbitmqctl<\/p>\n<p style=\"min-height: 24px;\">service rabbitmq-server start<\/p>\n<p style=\"min-height: 24px;\">service rabbitmq-server status<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000868\" data-ratio=\"0.4648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1916\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224227490.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000868\" data-ratio=\"0.4648148148148148\"  data-type=\"png\" data-w=\"1080\" width=\"1916\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224227490.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.4.\u914d\u7f6eweb\u7ba1\u7406\u754c\u9762<\/h2>\n<p style=\"min-height: 24px;\">rabbitmq-plugins enable rabbitmq_management<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000869\" data-ratio=\"0.3333333333333333\"  data-type=\"png\" data-w=\"1080\" width=\"1562\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224235980.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000869\" data-ratio=\"0.3333333333333333\"  data-type=\"png\" data-w=\"1080\" width=\"1562\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224235980.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.5.\u8bbf\u95ee<\/h2>\n<p style=\"min-height: 24px;\">\u901a\u8fc7ip+\u7aef\u53e3\u8bbf\u95ee\uff0c\u4f46\u662f\u767b\u5f55\u7684\u8bdd\u65e0\u6cd5\u4f7f\u7528guest\u767b\u5f55\uff0c\u56e0\u4e3aguest\u53ea\u5141\u8bb8\u5728localhost\u767b\u5f55\uff0c\u89e3\u51b3\u6b65\u9aa4\u53c2\u80036.6\u5f80\u4e0b<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000871\" data-ratio=\"0.5453703703703704\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224240828.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000871\" data-ratio=\"0.5453703703703704\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224240828.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">6.6.\u6dfb\u52a0admin\u7528\u6237<\/h2>\n<p style=\"min-height: 24px;\">rabbitmqctl add_user admin admin<\/p>\n<p style=\"min-height: 24px;\">rabbitmqctl set_permissions -p \/ admin \".\" \".\" \".*\"<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000870\" data-ratio=\"0.2212962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224243484.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000870\" data-ratio=\"0.2212962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224243484.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\">\u8fd9\u6837\u5c31\u53ef\u4ee5\u901a\u8fc7admin\/admin\u8bbf\u95ee\u63a7\u5236\u53f0\u4e86<\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000872\" data-ratio=\"0.5462962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224248288.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000872\" data-ratio=\"0.5462962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224248288.png\"  \/><\/noscript><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">7.RibbitMQ\u57fa\u7840\u4f7f\u7528<\/h1>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u642d\u5efa\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Web\u63a7\u5236\u53f0\u4e0a\u9009\u62e9Exchange\u6216\u8005Queue\u6765\u53d1\u9001\u6d88\u606f\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u7b80\u5355\u4f53\u9a8c\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u7559\u5230\u4e0b\u4e00\u90e8\u5206\u7f16\u7a0b\u6a21\u578b\u65f6\u518d\u6df1\u5165\u4f53\u9a8c\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">7.1.\u6dfb\u52a0\u4e00\u4e2a\u865a\u62df\u673a<\/span><\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000873\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224251255.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000873\" data-ratio=\"0.562962962962963\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224251255.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">7.2.<span style=\"color: rgb(51, 51, 51);\">\u521b\u5efa\u4e00\u4e2a\u7ecf\u5178\u961f\u5217<\/span><\/h2>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000877\" data-ratio=\"0.5046296296296297\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224256501.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000877\" data-ratio=\"0.5046296296296297\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224256501.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">7.3.\u9875\u9762\u6d88\u606f\u53d1\u9001<\/h2>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u9009\u62e9\u8fd9\u4e2a\u961f\u5217\uff0c\u5c31\u53ef\u4ee5\u5728\u9875\u9762\u4e0a\u76f4\u63a5\u53d1\u9001\u6d88\u606f\u4ee5\u53ca\u6d88\u8d39\u6d88\u606f\u4e86\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000875\" data-ratio=\"0.5046296296296297\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224300765.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000875\" data-ratio=\"0.5046296296296297\"  data-type=\"png\" data-w=\"1080\" width=\"1920\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224300765.png\"  \/><\/noscript><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">8.RabbitMQ\u57fa\u7840\u6982\u5ff5<\/h1>\n<p style=\"min-height: 24px;text-indent: 2em;\">RabbitMQ\u662f\u57fa\u4e8eAMQP\u534f\u8bae\u5f00\u53d1\u7684\u4e00\u4e2aMQ\u4ea7\u54c1\uff0c \u9996\u5148\u6211\u4eec\u4ee5Web\u7ba1\u7406\u9875\u9762\u4e3a \u5165\u53e3\uff0c\u6765\u4e86\u89e3\u4e0bRabbitMQ\u7684\u4e00\u4e9b\u57fa\u7840\u6982\u5ff5\uff0c\u8fd9\u6837\u6211\u4eec\u540e\u7eed\u624d\u597d\u9488\u5bf9\u8fd9\u4e9b\u57fa\u7840\u6982\u5ff5 \u8fdb\u884c\u7f16\u7a0b\u5b9e\u6218\u3002 \u53ef\u4ee5\u53c2\u7167\u4e0b\u56fe\u6765\u7406\u89e3RabbitMQ\u5f53\u4e2d\u7684\u57fa\u7840\u6982\u5ff5\uff1a <\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000878\" data-ratio=\"0.36666666666666664\"  data-type=\"png\" data-w=\"1080\" width=\"1803\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224304377.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000878\" data-ratio=\"0.36666666666666664\"  data-type=\"png\" data-w=\"1080\" width=\"1803\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224304377.png\"  \/><\/noscript><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">8.1. \u865a\u62df\u4e3b\u673a virtual host <\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e2a\u5728\u4e4b\u524d\u642d\u5efa\u65f6\u5df2\u7ecf\u4f53\u9a8c\u8fc7\u4e86\u3002RabbitMQ\u51fa\u4e8e\u670d\u52a1\u5668\u590d\u7528\u7684\u60f3\u6cd5\uff0c\u53ef\u4ee5\u5728\u4e00\u4e2aRabbitMQ\u96c6\u7fa4\u4e2d\u5212\u5206\u51fa\u591a\u4e2a\u865a\u62df\u4e3b\u673a\uff0c\u6bcf\u4e00\u4e2a\u865a\u62df\u4e3b\u673a\u90fd\u6709AMQP\u7684\u5168\u5957\u57fa\u7840\u7ec4\u4ef6\uff0c\u5e76\u4e14\u53ef\u4ee5\u9488\u5bf9\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\u8fdb\u884c\u6743\u9650\u4ee5\u53ca\u6570\u636e\u5206\u914d\uff0c\u5e76\u4e14\u4e0d\u540c\u865a\u62df\u4e3b\u673a\u4e4b\u95f4\u662f\u5b8c\u5168\u9694\u79bb\u7684\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">8.2.\u8fde\u63a5 Connection <\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5ba2\u6237\u7aef\u4e0eRabbitMQ\u8fdb\u884c\u4ea4\u4e92\uff0c\u9996\u5148\u5c31\u9700\u8981\u5efa\u7acb\u4e00\u4e2aTPC\u8fde\u63a5\uff0c\u8fd9\u4e2a\u8fde\u63a5\u5c31\u662fConnection\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">8.3.\u4fe1\u9053 Channel <\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"><\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4e00\u65e6\u5ba2\u6237\u7aef\u4e0eRabbitMQ\u5efa\u7acb\u4e86\u8fde\u63a5\uff0c\u5c31\u4f1a\u5206\u914d\u4e00\u4e2aAMQP\u4fe1\u9053 Channel\u3002\u6bcf\u4e2a\u4fe1\u9053\u90fd\u4f1a\u88ab\u5206\u914d\u4e00\u4e2a\u552f\u4e00\u7684ID\u3002\u4e5f\u53ef\u4ee5\u7406\u89e3\u4e3a\u662f\u5ba2\u6237\u7aef\u4e0eRabbitMQ\u5b9e\u9645\u8fdb\u884c\u6570\u636e\u4ea4\u4e92\u7684\u901a\u9053\uff0c\u6211\u4eec\u540e\u7eed\u7684\u5927\u591a\u6570\u7684\u6570\u636e\u64cd\u4f5c\u90fd\u662f\u5728\u4fe1\u9053 Channel \u8fd9\u4e2a\u5c42\u9762\u5c55\u5f00\u7684\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u4e3a\u4e86\u51cf\u5c11\u6027\u80fd\u5f00\u9500\uff0c\u4e5f\u4f1a\u5728\u4e00\u4e2aConnection\u4e2d\u5efa\u7acb\u591a\u4e2aChannel\uff0c\u8fd9\u6837\u4fbf\u4e8e\u5ba2\u6237\u7aef\u8fdb\u884c\u591a\u7ebf\u7a0b\u8fde\u63a5\uff0c\u8fd9\u4e9b\u8fde\u63a5\u4f1a\u590d\u7528\u540c\u4e00\u4e2aConnection\u7684TCP\u901a\u9053\uff0c\u6240\u4ee5\u5728\u5b9e\u9645\u4e1a\u52a1\u4e2d\uff0c\u5bf9\u4e8eConnection\u548cChannel\u7684\u5206\u914d\u4e5f\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u8003\u91cf\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">8.4.\u4ea4\u6362\u673a Exchange <\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u662fRabbitMQ\u4e2d\u8fdb\u884c\u6570\u636e\u8def\u7531\u7684\u91cd\u8981\u7ec4\u4ef6\u3002\u6d88\u606f\u53d1\u9001\u5230RabbitMQ\u4e2d\u540e\uff0c\u4f1a\u9996\u5148\u8fdb\u5165\u4e00\u4e2a\u4ea4\u6362\u673a\uff0c\u7136\u540e\u7531\u4ea4\u6362\u673a\u8d1f\u8d23\u5c06\u6570\u636e\u8f6c\u53d1\u5230\u4e0d\u540c\u7684\u961f\u5217\u4e2d\u3002RabbitMQ\u4e2d\u6709\u591a\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u4ea4\u6362\u673a\u6765\u652f\u6301\u4e0d\u540c\u7684\u8def\u7531\u7b56\u7565\u3002\u4eceWeb\u7ba1\u7406\u754c\u9762\u5c31\u80fd\u770b\u5230\uff0c\u5728\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\u4e2d\uff0cRabbitMQ\u90fd\u4f1a\u9ed8\u8ba4\u521b\u5efa\u51e0\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u4ea4\u6362\u673a\u6765\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000876\" data-ratio=\"0.3843700159489633\"  data-type=\"png\" data-w=\"627\" width=\"627\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224308183.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000876\" data-ratio=\"0.3843700159489633\"  data-type=\"png\" data-w=\"627\" width=\"627\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224308183.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4ea4\u6362\u673a\u591a\u7528\u6765\u4e0e\u751f\u4ea7\u8005\u6253\u4ea4\u9053\u3002\u751f\u4ea7\u8005\u53d1\u9001\u7684\u6d88\u606f\u901a\u8fc7Exchange\u4ea4\u6362\u673a\u5206\u914d\u5230\u5404\u4e2a\u4e0d\u540c\u7684Queue\u961f\u5217\u4e0a\uff0c\u800c\u5bf9\u4e8e\u6d88\u606f\u6d88\u8d39\u8005\u6765\u8bf4\uff0c\u901a\u5e38\u53ea\u9700\u8981\u5173\u6ce8\u81ea\u5df1\u611f\u5174\u8da3\u7684\u961f\u5217\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">8.5. \u961f\u5217 Queue <\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u961f\u5217\u662f\u5b9e\u9645\u4fdd\u5b58\u6570\u636e\u7684\u6700\u5c0f\u5355\u4f4d\u3002\u961f\u5217\u7ed3\u6784\u5929\u751f\u5c31\u5177\u6709FIFO\u7684\u987a\u5e8f\uff0c\u6d88\u606f\u6700\u7ec8\u90fd\u4f1a\u88ab\u5206\u53d1\u5230\u4e0d\u540c\u7684\u961f\u5217\u5f53\u4e2d\uff0c\u7136\u540e\u624d\u88ab\u6d88\u8d39\u8005\u8fdb\u884c\u6d88\u8d39\u5904\u7406\u3002\u8fd9\u4e5f\u662f\u6700\u8fd1RabbitMQ\u529f\u80fd\u53d8\u52a8\u6700\u5927\u7684\u5730\u65b9\u3002\u6700\u4e3a\u5e38\u7528\u7684\u662f\u7ecf\u5178\u961f\u5217Classic\u3002RabbitMQ 3.8.X\u7248\u672c\u6dfb\u52a0\u4e86Quorum\u961f\u5217\uff0c3.9.X\u53c8\u6dfb\u52a0\u4e86Stream\u961f\u5217\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">8.5.1.<span style=\"color: rgb(51, 51, 51);\">Classic \u7ecf\u5178\u961f\u5217<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u662fRabbitMQ\u6700\u4e3a\u7ecf\u5178\u7684\u961f\u5217\u7c7b\u578b\u3002\u5728\u5355\u673a\u73af\u5883\u4e2d\uff0c\u62e5\u6709\u6bd4\u8f83\u9ad8\u7684\u6d88\u606f\u53ef\u9760\u6027\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000874\" data-ratio=\"0.7238454288407163\"  data-type=\"png\" data-w=\"1061\" width=\"848.8\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224311540.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000874\" data-ratio=\"0.7238454288407163\"  data-type=\"png\" data-w=\"1061\" width=\"848.8\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224311540.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5728\u8fd9\u4e2a\u56fe\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u7ecf\u5178\u961f\u5217\u53ef\u4ee5\u9009\u62e9\u662f\u5426\u6301\u4e45\u5316(<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Durability<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">)\u4ee5\u53ca\u662f\u5426\u81ea\u52a8\u5220\u9664(<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Auto delete<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">)\u4e24\u4e2a\u5c5e\u6027\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5176\u4e2d\uff0cDurability\u6709\u4e24\u4e2a\u9009\u9879\uff0cDurable\u548cTransient\u3002 Durable\u8868\u793a\u961f\u5217\u4f1a\u5c06\u6d88\u606f\u4fdd\u5b58\u5230\u786c\u76d8\uff0c\u8fd9\u6837\u6d88\u606f\u7684\u5b89\u5168\u6027\u66f4\u9ad8\u3002\u4f46\u662f\u540c\u65f6\uff0c\u7531\u4e8e\u9700\u8981\u6709\u66f4\u591a\u7684IO\u64cd\u4f5c\uff0c\u6240\u4ee5\u751f\u4ea7\u548c\u6d88\u8d39\u6d88\u606f\u7684\u6027\u80fd\uff0c\u76f8\u6bd4Transient\u4f1a\u6bd4\u8f83\u4f4e\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Auto delete\u5c5e\u6027\u5982\u679c\u9009\u62e9\u4e3a\u662f\uff0c\u90a3\u961f\u5217\u5c06\u5728\u81f3\u5c11\u4e00\u4e2a\u6d88\u8d39\u8005\u5df2\u7ecf\u8fde\u63a5\uff0c\u7136\u540e\u6240\u6709\u7684\u6d88\u8d39\u8005\u90fd\u65ad\u5f00\u8fde\u63a5\u540e\u5220\u9664\u81ea\u5df1\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u540e\u9762\u7684Arguments\u90e8\u5206\uff0c\u8fd8\u6709\u975e\u5e38\u591a\u7684\u53c2\u6570\uff0c\u53ef\u4ee5\u70b9\u51fb\u540e\u9762\u7684\u95ee\u53f7\u9010\u6b65\u4e86\u89e3\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5176\u5b9e\u8fd9\u65f6\uff0c\u5e94\u8be5\u7ed3\u5408kafka\u548cRocketMQ\u8fd9\u51e0\u4e2aMQ\u4ea7\u54c1\uff0c\u5bf9\u961f\u5217\u6709\u4e00\u4e2a\u66f4\u5168\u9762\u7684\u7406\u89e3\u3002\u5728MQ\u5f53\u4e2d\uff0c\u961f\u5217\u5176\u5b9e\u662fMQ\u96c6\u7fa4\u4e2d\u7684\u4e00\u4e2a\u6570\u636e\u5206\u7247\u7684\u6700\u5c0f\u5355\u4f4d\u3002\u5728MQ\u96c6\u7fa4\u4e2d\uff0c\u4e00\u4e2aTopic\u4f1a\u5bf9\u5e94\u591a\u4e2a\u961f\u5217\uff0c\u800c\u8fd9\u4e9b\u961f\u5217\u4f1a\u5747\u5300\u7684\u5206\u914d\u5230\u96c6\u7fa4\u7684\u5404\u4e2a\u8282\u70b9\u5f53\u4e2d\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">8.5.2.<span style=\"color: rgb(51, 51, 51);\">Quorum \u4ef2\u88c1\u961f\u5217<\/span><\/h3>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4ef2\u88c1\u961f\u5217\uff0c\u662fRabbitMQ\u4ece3.8.0\u7248\u672c\uff0c\u5f15\u5165\u7684\u4e00\u4e2a\u65b0\u7684\u961f\u5217\u7c7b\u578b\uff0c\u6574\u4e2a3.8.X\u7248\u672c\uff0c\u4e5f\u90fd\u662f\u5728\u56f4\u7ed5\u4ef2\u88c1\u961f\u5217\u8fdb\u884c\u5b8c\u5584\u548c\u4f18\u5316\u3002\u4ef2\u88c1\u961f\u5217\u76f8\u6bd4Classic\u7ecf\u5178\u961f\u5217\uff0c\u5728\u5206\u5e03\u5f0f\u73af\u5883\u4e0b\u5bf9\u6d88\u606f\u7684\u53ef\u9760\u6027\u4fdd\u969c\u66f4\u9ad8\u3002\u5b98\u65b9\u6587\u6863\u4e2d\u8868\u793a\uff0c\u672a\u6765\u4f1a\u4f7f\u7528Quorum\u4ef2\u88c1\u961f\u5217\u4ee3\u66ff\u4f20\u7edfClassic\u961f\u5217\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Quorum\u662f\u57fa\u4e8eRaft\u4e00\u81f4\u6027\u534f\u8bae\u5b9e\u73b0\u7684\u4e00\u79cd\u65b0\u578b\u7684\u5206\u5e03\u5f0f\u6d88\u606f\u961f\u5217\uff0c\u4ed6\u5b9e\u73b0\u4e86\u6301\u4e45\u5316\uff0c\u591a\u5907\u4efd\u7684FIFO\u961f\u5217\uff0c\u4e3b\u8981\u5c31\u662f\u9488\u5bf9RabbitMQ\u7684\u955c\u50cf\u6a21\u5f0f\u8bbe\u8ba1\u7684\u3002\u7b80\u5355\u7406\u89e3\u5c31\u662fquorum\u961f\u5217\u4e2d\u7684\u6d88\u606f\u9700\u8981\u6709\u96c6\u7fa4\u4e2d\u591a\u534a\u8282\u70b9\u540c\u610f\u786e\u8ba4\u540e\uff0c\u624d\u4f1a\u5199\u5165\u5230\u961f\u5217\u4e2d\u3002\u8fd9\u79cd\u961f\u5217\u7c7b\u4f3c\u4e8eRocketMQ\u5f53\u4e2d\u7684DLedger\u96c6\u7fa4\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u4fdd\u8bc1\u6d88\u606f\u5728\u96c6\u7fa4\u5185\u90e8\u4e0d\u4f1a\u4e22\u5931\u3002\u540c\u65f6\uff0cQuorum\u662f\u4ee5\u727a\u7272\u5f88\u591a\u9ad8\u7ea7\u961f\u5217\u7279\u6027\u4e3a\u4ee3\u4ef7\uff0c\u6765\u8fdb\u4e00\u6b65\u4fdd\u8bc1\u6d88\u606f\u5728\u5206\u5e03\u5f0f\u73af\u5883\u4e0b\u7684\u9ad8\u53ef\u9760\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4ece\u6574\u4f53\u529f\u80fd\u4e0a\u6765\u8bf4\uff0cQuorum\u961f\u5217\u662f\u5728Classic\u7ecf\u5178\u961f\u5217\u7684\u57fa\u7840\u4e0a\u505a\u51cf\u6cd5\uff0c\u56e0\u6b64\u5bf9\u4e8eRabbitMQ\u7684\u957f\u671f\u4f7f\u7528\u8005\u800c\u8a00\uff0c\u5176\u5b9e\u662f\u4f1a\u5f71\u54cd\u4f7f\u7528\u4f53\u9a8c\u7684\u3002\u4ed6\u4e0e\u666e\u901a\u961f\u5217\u7684\u533a\u522b\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000882\" data-ratio=\"0.5583333333333333\"  data-type=\"png\" data-w=\"1080\" width=\"1319\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224316171.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000882\" data-ratio=\"0.5583333333333333\"  data-type=\"png\" data-w=\"1080\" width=\"1319\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224316171.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4ece\u5b98\u65b9\u8fd9\u4e2a\u6bd4\u8f83\u56fe\u5c31\u80fd\u770b\u5230\uff0cQuorum\u961f\u5217\u5927\u90e8\u5206\u529f\u80fd\u90fd\u662f\u5728Classic\u961f\u5217\u57fa\u7840\u4e0a\u505a\u51cf\u6cd5\uff0c\u6bd4\u5982Non-durable queues\u8868\u793a\u662f\u975e\u6301\u4e45\u5316\u7684\u5185\u5b58\u961f\u5217\u3002Exclusivity\u8868\u793a\u72ec\u5360\u961f\u5217\uff0c\u5373\u8868\u793a\u961f\u5217\u53ea\u80fd\u7531\u58f0\u660e\u8be5\u961f\u5217\u7684Connection\u8fde\u63a5\u6765\u8fdb\u884c\u4f7f\u7528\uff0c\u5305\u62ec\u961f\u5217\u521b\u5efa\u3001\u5220\u9664\u3001\u6536\u53d1\u6d88\u606f\u7b49\uff0c\u5e76\u4e14\u72ec\u5360\u961f\u5217\u4f1a\u5728\u58f0\u660e\u8be5\u961f\u5217\u7684Connection\u65ad\u5f00\u540e\u81ea\u52a8\u5220\u9664\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5176\u4e2d\u6709\u4e2a\u7279\u4f8b\u5c31\u662f\u8fd9\u4e2aPoison Message(\u6709\u6bd2\u7684\u6d88\u606f)\u3002\u6240\u8c13\u6bd2\u6d88\u606f\u662f\u6307\u6d88\u606f\u4e00\u76f4\u4e0d\u80fd\u88ab\u6d88\u8d39\u8005\u6b63\u5e38\u6d88\u8d39(\u53ef\u80fd\u662f\u7531\u4e8e\u6d88\u8d39\u8005\u5931\u8d25\u6216\u8005\u6d88\u8d39\u903b\u8f91\u6709\u95ee\u9898\u7b49)\uff0c\u5c31\u4f1a\u5bfc\u81f4\u6d88\u606f\u4e0d\u65ad\u7684\u91cd\u65b0\u5165\u961f\uff0c\u8fd9\u6837\u8fd9\u4e9b\u6d88\u606f\u5c31\u6210\u4e3a\u4e86\u6bd2\u6d88\u606f\u3002\u8fd9\u4e9b\u8bfb\u6d88\u606f\u5e94\u8be5\u6709\u4fdd\u969c\u673a\u5236\u8fdb\u884c\u6807\u8bb0\u5e76\u53ca\u65f6\u5220\u9664\u3002Quorum\u961f\u5217\u4f1a\u6301\u7eed\u8ddf\u8e2a\u6d88\u606f\u7684\u5931\u8d25\u6295\u9012\u5c1d\u8bd5\u6b21\u6570\uff0c\u5e76\u8bb0\u5f55\u5728\"x-delivery-count\"\u8fd9\u6837\u4e00\u4e2a\u5934\u90e8\u53c2\u6570\u4e2d\u3002\u7136\u540e\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e Delivery limit\u53c2\u6570\u6765\u5b9a\u5236\u4e00\u4e2a\u6bd2\u6d88\u606f\u7684\u5220\u9664\u7b56\u7565\u3002\u5f53\u6d88\u606f\u7684\u91cd\u590d\u6295\u9012\u6b21\u6570\u8d85\u8fc7\u4e86Delivery limit\u53c2\u6570\u9608\u503c\u65f6\uff0cRabbitMQ\u5c31\u4f1a\u5220\u9664\u8fd9\u4e9b\u6bd2\u6d88\u606f\u3002\u5f53\u7136\uff0c\u5982\u679c\u914d\u7f6e\u4e86\u6b7b\u4fe1\u961f\u5217\u7684\u8bdd\uff0c\u5c31\u4f1a\u8fdb\u5165\u5bf9\u5e94\u7684\u6b7b\u4fe1\u961f\u5217\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Quorum\u961f\u5217\u66f4\u9002\u5408\u4e8e \u961f\u5217\u957f\u671f\u5b58\u5728\uff0c\u5e76\u4e14\u5bf9\u5bb9\u9519\u3001\u6570\u636e\u5b89\u5168\u65b9\u9762\u7684\u8981\u6c42\u6bd4\u4f4e\u5ef6\u8fdf\u3001\u4e0d\u6301\u4e45\u7b49\u9ad8\u7ea7\u961f\u5217\u66f4\u80fd\u8981\u6c42\u66f4\u4e25\u683c\u7684\u573a\u666f\u3002**\u4f8b\u5982 \u7535\u5546\u7cfb\u7edf\u7684\u8ba2\u5355\uff0c\u5f15\u5165MQ\u540e\uff0c\u5904\u7406\u901f\u5ea6\u53ef\u4ee5\u6162\u4e00\u70b9\uff0c\u4f46\u662f\u8ba2\u5355\u4e0d\u80fd\u4e22\u5931\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4e5f\u5bf9\u5e94\u4ee5\u4e0b\u4e00\u4e9b\u4e0d\u9002\u5408\u4f7f\u7528\u7684\u573a\u666f\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">1\u3001\u4e00\u4e9b\u4e34\u65f6\u4f7f\u7528\u7684\u961f\u5217\uff1a\u6bd4\u5982transient\u4e34\u65f6\u961f\u5217\uff0cexclusive\u72ec\u5360\u961f\u5217\uff0c\u6216\u8005\u7ecf\u5e38\u4f1a\u4fee\u6539\u548c\u5220\u9664\u7684\u961f\u5217\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">2\u3001\u5bf9\u6d88\u606f\u4f4e\u5ef6\u8fdf\u8981\u6c42\u9ad8\uff1a \u4e00\u81f4\u6027\u7b97\u6cd5\u4f1a\u5f71\u54cd\u6d88\u606f\u7684\u5ef6\u8fdf\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">3\u3001\u5bf9\u6570\u636e\u5b89\u5168\u6027\u8981\u6c42\u4e0d\u9ad8\uff1aQuorum\u961f\u5217\u9700\u8981\u6d88\u8d39\u8005\u624b\u52a8\u901a\u77e5\u6216\u8005\u751f\u4ea7\u8005\u624b\u52a8\u786e\u8ba4\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">4\u3001\u961f\u5217\u6d88\u606f\u79ef\u538b\u4e25\u91cd \uff1a \u5982\u679c\u961f\u5217\u4e2d\u7684\u6d88\u606f\u5f88\u5927\uff0c\u6216\u8005\u79ef\u538b\u7684\u6d88\u606f\u5f88\u591a\uff0c\u5c31\u4e0d\u8981\u4f7f\u7528Quorum\u961f\u5217\u3002Quorum\u961f\u5217\u5f53\u524d\u4f1a\u5c06\u6240\u6709\u6d88\u606f\u59cb\u7ec8\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\uff0c\u76f4\u5230\u8fbe\u5230\u5185\u5b58\u4f7f\u7528\u6781\u9650\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">\u6269\u5c55\uff1a<\/span><span style=\"color: rgb(51, 51, 51);\">Raft\u4e00\u81f4\u6027\u534f\u8bae<\/span><\/h3>\n<p style=\"min-height: 24px;\">Raft\u662f\u4e00\u79cd\u7528\u4e8e\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u5b9e\u73b0\u4e00\u81f4\u6027\u7684\u534f\u8bae\uff0c\u5b83\u65e8\u5728\u63d0\u4f9b\u6bd4\u4f20\u7edf\u7684Paxos\u7b97\u6cd5\u66f4\u6613\u4e8e\u7406\u89e3\u7684\u4e00\u79cd\u65b9\u6cd5\u3002Raft\u7684\u8bbe\u8ba1\u76ee\u6807\u662f\u4f7f\u5de5\u7a0b\u5e08\u66f4\u5bb9\u6613\u7406\u89e3\u548c\u5b9e\u73b0\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u7b97\u6cd5\uff0c\u4ece\u800c\u63a8\u52a8\u5206\u5e03\u5f0f\u7cfb\u7edf\u9886\u57df\u7684\u8fdb\u6b65\u3002<\/p>\n<p style=\"min-height: 24px;\">\u4ee5\u4e0b\u662fRaft\u534f\u8bae\u7684\u4e00\u4e9b\u5173\u952e\u6982\u5ff5\u548c\u673a\u5236\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p>\u9886\u5bfc\u8005\u9009\u4e3e\uff08Leader Election\uff09\uff1aRaft\u534f\u8bae\u57fa\u4e8e\u9886\u5bfc\u8005\uff08leader\uff09\u548c\u8ddf\u968f\u8005\uff08follower\uff09\u7684\u6a21\u578b\u3002\u5728\u521d\u59cb\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u8282\u70b9\u90fd\u662f\u8ddf\u968f\u8005\u3002\u5f53\u6ca1\u6709\u9886\u5bfc\u8005\u65f6\uff0c\u4efb\u4f55\u8282\u70b9\u90fd\u53ef\u4ee5\u6210\u4e3a\u5019\u9009\u4eba\u5e76\u53d1\u8d77\u9009\u4e3e\u3002\u9009\u4e3e\u901a\u8fc7RPC\uff08\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528\uff09\u6765\u8fdb\u884c\uff0c\u5019\u9009\u4eba\u9700\u8981\u83b7\u5f97\u5927\u591a\u6570\u8282\u70b9\u7684\u9009\u7968\u624d\u80fd\u6210\u4e3a\u65b0\u7684\u9886\u5bfc\u8005\u3002<\/p>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u590d\u5236\uff08Log Replication\uff09\uff1a\u4e00\u65e6\u9009\u51fa\u9886\u5bfc\u8005\uff0c\u5b83\u5c31\u8d1f\u8d23\u63a5\u6536\u5ba2\u6237\u7aef\u8bf7\u6c42\uff0c\u5e76\u5c06\u8fd9\u4e9b\u8bf7\u6c42\u9644\u52a0\u5230\u81ea\u5df1\u7684\u65e5\u5fd7\u4e2d\u3002\u7136\u540e\uff0c\u9886\u5bfc\u8005\u4f1a\u5411\u5176\u4ed6\u8282\u70b9\u53d1\u9001\u65e5\u5fd7\u6761\u76ee\u7684\u590d\u5236\u8bf7\u6c42\uff0c\u786e\u4fdd\u6240\u6709\u8282\u70b9\u90fd\u590d\u5236\u4e86\u76f8\u540c\u7684\u65e5\u5fd7\u8bb0\u5f55\u3002\u53ea\u6709\u5f53\u5927\u591a\u6570\u8282\u70b9\u786e\u8ba4\u5df2\u7ecf\u5e94\u7528\u4e86\u67d0\u4e2a\u65e5\u5fd7\u6761\u76ee\u65f6\uff0c\u8be5\u65e5\u5fd7\u6761\u76ee\u624d\u88ab\u8ba4\u4e3a\u662f\u5df2\u63d0\u4ea4\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b89\u5168\u6027\uff08Safety\uff09\uff1aRaft\u534f\u8bae\u901a\u8fc7\u5f15\u5165\u5404\u79cd\u5b89\u5168\u673a\u5236\u6765\u786e\u4fdd\u7cfb\u7edf\u5728\u51fa\u73b0\u7f51\u7edc\u5206\u533a\u6216\u5176\u4ed6\u5f02\u5e38\u60c5\u51b5\u65f6\u4ecd\u80fd\u4fdd\u6301\u4e00\u81f4\u6027\u3002\u4f8b\u5982\uff0c\u5728\u9886\u5bfc\u8005\u9009\u4e3e\u8fc7\u7a0b\u4e2d\uff0c\u6bcf\u4e2a\u5019\u9009\u4eba\u90fd\u4f1a\u5305\u542b\u81ea\u5df1\u7684\u4efb\u671f\u53f7\u7801\uff0c\u4ee5\u907f\u514d\u8fc7\u671f\u7684\u9886\u5bfc\u8005\u4ea7\u751f\u3002\u6b64\u5916\uff0cRaft\u8fd8\u4f7f\u7528\u4e86\u9012\u589e\u7684\u65e5\u5fd7\u7d22\u5f15\u6765\u786e\u4fdd\u65e5\u5fd7\u7684\u4e00\u81f4\u6027\u548c\u987a\u5e8f\u6027\u3002<\/p>\n<\/li>\n<\/ol>\n<p style=\"min-height: 24px;\">\u603b\u4f53\u800c\u8a00\uff0cRaft\u534f\u8bae\u63d0\u4f9b\u4e86\u4e00\u79cd\u6e05\u6670\u3001\u53ef\u7406\u89e3\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\uff0c\u4f7f\u5f97\u5de5\u7a0b\u5e08\u66f4\u5bb9\u6613\u7406\u89e3\u548c\u90e8\u7f72\u5206\u5e03\u5f0f\u7cfb\u7edf\u3002\u7531\u4e8e\u5176\u4f18\u96c5\u7684\u8bbe\u8ba1\u548c\u6613\u7528\u6027\uff0cRaft\u534f\u8bae\u5728\u5b9e\u9645\u7cfb\u7edf\u4e2d\u5f97\u5230\u4e86\u5e7f\u6cdb\u7684\u5e94\u7528\u3002<\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">8.5.3.<span style=\"color: rgb(51, 51, 51);\">Stream\u961f\u5217<\/span><\/h3>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Stream\u961f\u5217\u662fRabbitMQ\u81ea3.9.0\u7248\u672c\u5f00\u59cb\u5f15\u5165\u7684\u4e00\u79cd\u65b0\u7684\u6570\u636e\u961f\u5217\u7c7b\u578b\uff0c\u4e5f\u662f\u76ee\u524d\u5b98\u65b9\u6700\u4e3a\u63a8\u8350\u7684\u961f\u5217\u7c7b\u578b\u3002\u8fd9\u79cd\u961f\u5217\u7c7b\u578b\u7684\u6d88\u606f\u662f\u6301\u4e45\u5316\u5230\u78c1\u76d8\u5e76\u4e14\u5177\u5907\u5206\u5e03\u5f0f\u5907\u4efd\u7684\uff0c\u66f4\u9002\u5408\u4e8e\u6d88\u8d39\u8005\u591a\uff0c\u8bfb\u6d88\u606f\u975e\u5e38\u9891\u7e41\u7684\u573a\u666f\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000881\" data-ratio=\"0.6633954857703631\"  data-type=\"png\" data-w=\"1019\" width=\"815.2\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224321182.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000881\" data-ratio=\"0.6633954857703631\"  data-type=\"png\" data-w=\"1019\" width=\"815.2\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224321182.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Stream\u961f\u5217\u7684\u6838\u5fc3\u662f\u4ee5append-only\u53ea\u6dfb\u52a0\u7684\u65e5\u5fd7\u6765\u8bb0\u5f55\u6d88\u606f\uff0c\u6574\u4f53\u6765\u8bf4\uff0c\u5c31\u662f\u6d88\u606f\u5c06\u4ee5append-only\u7684\u65b9\u5f0f\u6301\u4e45\u5316\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d\uff0c\u7136\u540e\u901a\u8fc7\u8c03\u6574\u6bcf\u4e2a\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u8fdb\u5ea6offset\uff0c\u6765\u5b9e\u73b0\u6d88\u606f\u7684\u591a\u6b21\u5206\u53d1\u3002\u4e0b\u65b9\u6709\u51e0\u4e2a\u5c5e\u6027\u4e5f\u90fd\u662f\u6765\u5b9a\u4e49\u65e5\u5fd7\u6587\u4ef6\u7684\u5927\u5c0f\u4ee5\u53ca\u4fdd\u5b58\u65f6\u95f4\u3002\u5982\u679c\u4f60\u719f\u6089Kafka\u6216\u8005RocketMQ\uff0c\u4f1a\u5bf9\u8fd9\u79cd\u65e5\u5fd7\u8bb0\u5f55\u6d88\u606f\u7684\u65b9\u5f0f\u975e\u5e38\u719f\u6089\u3002\u8fd9\u79cd\u961f\u5217\u63d0\u4f9b\u4e86RabbitMQ\u5df2\u6709\u7684\u5176\u4ed6\u961f\u5217\u7c7b\u578b\u4e0d\u592a\u597d\u5b9e\u73b0\u7684\u56db\u4e2a\u7279\u70b9\uff1a<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">1\u3001large fan-outs \u5927\u89c4\u6a21\u5206\u53d1<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5f53\u60f3\u8981\u5411\u591a\u4e2a\u8ba2\u9605\u8005\u53d1\u9001\u76f8\u540c\u7684\u6d88\u606f\u65f6\uff0c\u4ee5\u5f80\u7684\u961f\u5217\u7c7b\u578b\u5fc5\u987b\u4e3a\u6bcf\u4e2a\u6d88\u8d39\u8005\u7ed1\u5b9a\u4e00\u4e2a\u4e13\u7528\u7684\u961f\u5217\u3002\u5982\u679c\u6d88\u8d39\u8005\u7684\u6570\u91cf\u5f88\u5927\uff0c\u8fd9\u5c31\u4f1a\u5bfc\u81f4\u6027\u80fd\u4f4e\u4e0b\u3002\u800cStream\u961f\u5217\u5141\u8bb8\u4efb\u610f\u6570\u91cf\u7684\u6d88\u8d39\u8005\u4f7f\u7528\u540c\u4e00\u4e2a\u961f\u5217\u7684\u6d88\u606f\uff0c\u4ece\u800c\u6d88\u9664\u7ed1\u5b9a\u591a\u4e2a\u961f\u5217\u7684\u9700\u6c42\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">2\u3001Replay\/Time-travelling \u6d88\u606f\u56de\u6eaf<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u5df2\u6709\u7684\u8fd9\u4e9b\u961f\u5217\u7c7b\u578b\uff0c\u5728\u6d88\u8d39\u8005\u5904\u7406\u5b8c\u6d88\u606f\u540e\uff0c\u6d88\u606f\u90fd\u4f1a\u4ece\u961f\u5217\u4e2d\u5220\u9664\uff0c\u56e0\u6b64\uff0c\u65e0\u6cd5\u91cd\u65b0\u8bfb\u53d6\u5df2\u7ecf\u6d88\u8d39\u8fc7\u7684\u6d88\u606f\u3002\u800cStream\u961f\u5217\u5141\u8bb8\u7528\u6237\u5728\u65e5\u5fd7\u7684\u4efb\u4f55\u4e00\u4e2a\u8fde\u63a5\u70b9\u5f00\u59cb\u91cd\u65b0\u8bfb\u53d6\u6570\u636e\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">3\u3001Throughput Performance \u9ad8\u541e\u5410\u6027\u80fd<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Strem\u961f\u5217\u7684\u8bbe\u8ba1\u4ee5\u6027\u80fd\u4e3a\u4e3b\u8981\u76ee\u6807\uff0c\u5bf9\u6d88\u606f\u4f20\u9012\u541e\u5410\u91cf\u7684\u63d0\u5347\u975e\u5e38\u660e\u663e\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">4\u3001Large logs \u5927\u65e5\u5fd7<\/span><\/h4>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u4e00\u76f4\u4ee5\u6765\u6709\u4e00\u4e2a\u8ba9\u4eba\u8bdf\u75c5\u7684\u5730\u65b9\uff0c\u5c31\u662f\u5f53\u961f\u5217\u4e2d\u79ef\u7d2f\u7684\u6d88\u606f\u8fc7\u591a\u65f6\uff0c\u6027\u80fd\u4e0b\u964d\u4f1a\u975e\u5e38\u660e\u663e\u3002\u4f46\u662fStream\u961f\u5217\u7684\u8bbe\u8ba1\u76ee\u6807\u5c31\u662f\u4ee5\u6700\u5c0f\u7684\u5185\u5b58\u5f00\u9500\u9ad8\u6548\u5730\u5b58\u50a8\u5927\u91cf\u7684\u6570\u636e\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6574\u4f53\u4e0a\u6765\u8bf4\uff0cRabbitMQ\u7684Stream\u961f\u5217\uff0c\u5176\u5b9e\u6709\u5f88\u591a\u5730\u65b9\u501f\u9274\u4e86\u5176\u4ed6MQ\u4ea7\u54c1\u7684\u4f18\u70b9\uff0c\u5728\u4fdd\u8bc1\u6d88\u606f\u53ef\u9760\u6027\u7684\u57fa\u7840\u4e0a\uff0c\u7740\u529b\u63d0\u9ad8\u961f\u5217\u7684\u6d88\u606f\u541e\u5410\u91cf\u4ee5\u53ca\u6d88\u606f\u8f6c\u53d1\u6027\u80fd\u3002\u56e0\u6b64\uff0cStream\u4e5f\u662f\u5728\u89c6\u56fe\u89e3\u51b3\u4e00\u4e2aRabbitMQ\u4e00\u76f4\u4ee5\u6765\uff0c\u8ba9\u4eba\u8bdf\u75c5\u7684\u7f3a\u70b9\uff0c\u5c31\u662f\u5f53\u961f\u5217\u4e2d\u79ef\u7d2f\u7684\u6d88\u606f\u8fc7\u591a\u65f6\uff0c\u6027\u80fd\u4e0b\u964d\u4f1a\u975e\u5e38\u660e\u663e\u7684\u95ee\u9898\u3002RabbitMQ\u4ee5\u5f80\u66f4\u4e13\u6ce8\u4e8e\u4f01\u4e1a\u7ea7\u7684\u5185\u90e8\u4f7f\u7528\uff0c\u4f46\u662f\u4ece\u8fd9\u4e9b\u961f\u5217\u529f\u80fd\u53ef\u4ee5\u770b\u5230\uff0cRabbitmq\u4e5f\u5728\u5411\u66f4\u590d\u6742\u7684\u4e92\u8054\u7f51\u73af\u5883\u9760\u62e2\uff0c\u672a\u6765\u5bf9\u4e8eRabbitMQ\u7684\u4e86\u89e3\uff0c\u4e5f\u9700\u8981\u968f\u7740\u7248\u672c\u63a8\u8fdb\uff0c\u4e0d\u65ad\u66f4\u65b0\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f46\u662f\uff0c\u4ece\u6574\u4f53\u529f\u80fd\u4e0a\u6765\u8bb2\uff0c\u961f\u5217\u53ea\u4e0d\u8fc7\u662f\u4e00\u4e2a\u5b9e\u73b0FIFO\u7684\u6570\u636e\u7ed3\u6784\u800c\u5df2\uff0c\u8fd9\u79cd\u6570\u636e\u7ed3\u6784\u5176\u5b9e\u662f\u8d8a\u7b80\u5355\u8d8a\u597d\u3002\u800c\u5f53\u524dRabbitMQ\u533a\u5206\u51fa\u8fd9\u4e48\u591a\u79cd\u961f\u5217\u7c7b\u578b\uff0c\u5176\u5b9e\u6781\u5927\u7684\u589e\u52a0\u4e86\u5e94\u7528\u5c42\u9762\u7684\u4f7f\u7528\u96be\u5ea6\uff0c\u5e94\u7528\u5c42\u9762\u5fc5\u987b\u6709\u4e00\u4e9b\u4e0d\u540c\u7684\u673a\u5236\u517c\u5bb9\u5404\u79cd\u961f\u5217\u3002\u6240\u4ee5\uff0c\u5728\u672a\u6765\u7248\u672c\u4e2d\uff0cRabbitMQ\u5f88\u53ef\u80fd\u8fd8\u662f\u4f1a\u5c06\u8fd9\u51e0\u79cd\u961f\u5217\u7c7b\u578b\u6700\u7ec8\u7edf\u4e00\u6210\u4e00\u79cd\u7c7b\u578b\u3002\u4f8b\u5982\u5b98\u65b9\u5df2\u7ecf\u8bf4\u660e\u672a\u6765\u4f1a\u4f7f\u7528Quorum\u961f\u5217\u7c7b\u578b\u66ff\u4ee3\u7ecf\u5178\u961f\u5217\uff0c\u5230\u90a3\u65f6\uff0c\u5e94\u7528\u5c42\u5f88\u591a\u5de5\u5177\u5c31\u53ef\u4ee5\u5f97\u5230\u7b80\u5316\uff0c\u6bd4\u5982\u4e0d\u9700\u8981\u518d\u8bbe\u7f6edurable\u548cexclusive\u5c5e\u6027\u3002\u867d\u7136Quorum\u961f\u5217\u548cStream\u961f\u5217\u76ee\u524d\u8fd8\u6ca1\u6709\u5408\u5e76\u7684\u6253\u7b97\uff0c\u4f46\u662f\u5728\u5e94\u7528\u5c42\u9762\u6765\u770b\uff0c\u4ed6\u4eec\u4e24\u8005\u662f\u51b2\u7a81\u7684\uff0c\u662f\u4e00\u79cd\u7ade\u4e89\u5173\u7cfb\uff0c\u672a\u6765\u4e5f\u5f88\u6709\u53ef\u80fd\u6700\u7ec8\u7edf\u4e00\u4fdd\u7559\u6210\u4e00\u79cd\u7c7b\u578b\u3002\u81f3\u4e8e\u672a\u6765\u8d70\u5411\u5982\u4f55\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u540e\u7eed\u7248\u672c\u62ed\u76ee\u4ee5\u5f85\u3002<\/span><\/p>\n<h1 style=\"font-size: 28px;line-height: 36px;margin-top: 26px;margin-bottom: 10px;\">9.RabbitMQ\u7f16\u7a0b\u6a21\u578b<\/h1>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u7684\u4f7f\u7528\u751f\u6001\u5df2\u7ecf\u76f8\u5f53\u5e9e\u5927\uff0c\u652f\u6301\u975e\u5e38\u591a\u7684\u8bed\u8a00\u3002\u800c\u5c31\u4ee5java\u800c\u8bba\uff0c\u4e5f\u5df2\u7ecf\u652f\u6301\u975e\u5e38\u591a\u7684\u6269\u5c55\u3002\u6211\u4eec\u63a5\u4e0b\u6765\u4f1a\u4ece\u539f\u751fAPI\u3001SpringBoot\u96c6\u6210\u3001SpringCloudStream\u96c6\u6210\uff0c\u4e09\u4e2a\u89d2\u5ea6\u6765\u8be6\u7ec6\u5b66\u4e60RabbitMQ\u7684\u7f16\u7a0b\u6a21\u578b\u3002\u5728\u5b66\u4e60\u7f16\u7a0b\u6a21\u578b\u65f6\uff0c\u8981\u6ce8\u610f\u4e0b\uff0c\u65b0\u63a8\u51fa\u7684Stream\u961f\u5217\uff0c\u4ed6\u7684\u5ba2\u6237\u7aef\u8ddf\u53e6\u5916\u4e24\u79cd\u961f\u5217\u7a0d\u6709\u4e0d\u540c\u3002<\/span><\/p>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">9.1.\u539f\u751fAPI<\/h2>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f7f\u7528RabbitMQ\u63d0\u4f9b\u7684\u539f\u751f\u5ba2\u6237\u7aefAPI\u8fdb\u884c\u4ea4\u4e92\u3002\u5148\u6765\u4e86\u89e3\u4e0b\u5982\u4f55\u4f7f\u7528Classic\u548cQuorum\u961f\u5217\u3002\u81f3\u4e8eStream\u961f\u5217\uff0c\u76ee\u524d\u4ed6\u4f7f\u7528\u7684\u662f\u548c\u8fd9\u4e24\u4e2a\u961f\u5217\u4e0d\u540c\u7684\u5ba2\u6237\u7aef<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">9.1.1.Maven\u4f9d\u8d56<\/h3>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>&lt;dependency&gt;    &lt;groupId&gt;com.rabbitmq&lt;\/groupId&gt;    &lt;artifactId&gt;amqp-client&lt;\/artifactId&gt;    &lt;version&gt;5.9.0&lt;\/version&gt;&lt;\/dependency&gt;<\/code><\/pre>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.2.\u57fa\u7840\u7f16\u7a0b\u6a21\u578b<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e9b\u5404\u79cd\u5404\u6837\u7684\u6d88\u606f\u6a21\u578b\u5176\u5b9e\u90fd\u5bf9\u5e94\u4e00\u4e2a\u6bd4\u8f83\u7edf\u4e00\u7684\u57fa\u7840\u7f16\u7a0b\u6a21\u578b\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">step1\u3001\u9996\u5148\u521b\u5efa\u8fde\u63a5\uff0c\u83b7\u53d6Channel<\/h4>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>ConnectionFactory factory = new ConnectionFactory();factory.setHost(\"localhost\");connection = factory.newConnection();channel = connection.createChannel();<\/code><\/pre>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">step2\u3001\u58f0\u660equeue\u961f\u5217<\/span><\/h4>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map&lt;String, Object&gt; arguments);<\/code><\/pre>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5982\u679c\u8981\u58f0\u660e\u4e00\u4e2aQuorum\u961f\u5217\uff0c\u5219\u53ea\u9700\u8981\u5728\u540e\u9762\u7684arguments\u4e2d\u4f20\u5165\u4e00\u4e2a\u53c2\u6570\uff0c<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">x-queue-type<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\uff0c\u53c2\u6570\u503c\u8bbe\u5b9a\u4e3a<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">quorum<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>Map&lt;String,Object&gt; params = new HashMap&lt;&gt;();params.put(\"x-queue-type\",\"quorum\");\/\/\u58f0\u660eQuorum\u961f\u5217\u7684\u65b9\u5f0f\u5c31\u662f\u6dfb\u52a0\u4e00\u4e2ax-queue-type\u53c2\u6570\uff0c\u6307\u5b9a\u4e3aquorum\u3002\u9ed8\u8ba4\u662fclassicchannel.queueDeclare(QUEUE_NAME, true, false, false, params);<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u6ce8\u610f\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">1\u3001\u5bf9\u4e8eQuorum\u7c7b\u578b\uff0cdurable\u53c2\u6570\u5c31\u5fc5\u987b\u662ftrue\u4e86\uff0c\u8bbe\u7f6e\u6210false\u7684\u8bdd\uff0c\u4f1a\u62a5\u9519\u3002\u540c\u6837\uff0cexclusive\u53c2\u6570\u5fc5\u987b\u8bbe\u7f6e\u4e3afalse<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5982\u679c\u8981\u58f0\u660e\u4e00\u4e2aStream\u961f\u5217\uff0c\u5219 <\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">x-queue-type<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u53c2\u6570\u8981\u8bbe\u7f6e\u4e3a <\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">stream<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> .<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>Map&lt;String,Object&gt; params = new HashMap&lt;&gt;();params.put(\"x-queue-type\",\"stream\");params.put(\"x-max-length-bytes\", 20_000_000_000L); \/\/ maximum stream size: 20 GBparams.put(\"x-stream-max-segment-size-bytes\", 100_000_000); \/\/ size of segment files: 100 MBchannel.queueDeclare(QUEUE_NAME, true, false, false, params);<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u6ce8\u610f\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">1\u3001\u540c\u6837\uff0cdurable\u53c2\u6570\u5fc5\u987b\u662ftrue\uff0cexclusive\u5fc5\u987b\u662ffalse\u3002 --\u4f60\u5e94\u8be5\u4f1a\u60f3\u5230\uff0c\u5bf9\u4e8e\u8fd9\u4e24\u79cd\u961f\u5217\uff0c\u8fd9\u4e24\u4e2a\u53c2\u6570\u5c31\u662f\u591a\u4f59\u7684\u4e86\uff0c\u672a\u6765\u53ef\u4ee5\u76f4\u63a5\u5220\u9664\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">2\u3001x-max-length-bytes \u8868\u793a\u65e5\u5fd7\u6587\u4ef6\u7684\u6700\u5927\u5b57\u8282\u6570\u3002x-stream-max-segment-size-bytes \u6bcf\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6\u7684\u6700\u5927\u5927\u5c0f\u3002\u8fd9\u4e24\u4e2a\u662f\u53ef\u9009\u53c2\u6570\uff0c\u901a\u5e38\u4e3a\u4e86\u9632\u6b62stream\u65e5\u5fd7\u65e0\u9650\u5236\u7d2f\u8ba1\uff0c\u90fd\u4f1a\u914d\u5408stream\u961f\u5217\u4e00\u8d77\u58f0\u660e\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u58f0\u660e\u7684\u961f\u5217\uff0c\u5982\u679c\u670d\u52a1\u7aef\u6ca1\u6709\uff0c\u90a3\u4e48\u4f1a\u81ea\u52a8\u521b\u5efa\u3002\u4f46\u662f\u5982\u679c\u670d\u52a1\u7aef\u6709\u4e86\u8fd9\u4e2a\u961f\u5217\uff0c\u90a3\u4e48\u58f0\u660e\u7684\u961f\u5217\u5c5e\u6027\u5fc5\u987b\u548c\u670d\u52a1\u7aef\u7684\u961f\u5217\u5c5e\u6027\u4e00\u81f4\u624d\u884c\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">step3\u3001Producer\u6839\u636e\u5e94\u7528\u573a\u666f\u53d1\u9001\u6d88\u606f\u5230queue<\/span><\/h4>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.basicPublish(String exchange, String routingKey, BasicProperties props,message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5176\u4e2dexchange\u662f\u4e00\u4e2aProducer\u4e0equeue\u7684\u4e2d\u95f4\u4ea4\u4e92\u673a\u5236\u3002\u53ef\u4ee5\u8ba9Producer\u628a\u6d88\u606f\u6309\u4e00\u5b9a\u7684\u89c4\u5219\u53d1\u9001\u5230\u4e0d\u540c\u7684queue\uff0c\u4e0d\u9700\u8981\u7684\u8bdd\u5c31\u4f20\u7a7a\u5b57\u7b26\u4e32<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">step4\u3001Consumer\u6d88\u8d39\u6d88\u606f<\/span><\/h4>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5b9a\u4e49\u6d88\u8d39\u8005\uff0c\u6d88\u8d39\u6d88\u606f\u8fdb\u884c\u5904\u7406\uff0c\u5e76\u5411RabbitMQ\u8fdb\u884c\u6d88\u606f\u786e\u8ba4\u3002\u786e\u8ba4\u4e86\u4e4b\u540e\u5c31\u8868\u660e\u8fd9\u4e2a\u6d88\u606f\u5df2\u7ecf\u6d88\u8d39\u5b8c\u4e86\uff0c\u5426\u5219RabbitMQ\u8fd8\u4f1a\u7ee7\u7eed\u8ba9\u522b\u7684\u6d88\u8d39\u8005\u5b9e\u4f8b\u6765\u5904\u7406\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4e3b\u8981\u6536\u96c6\u4e86\u4e24\u79cd\u6d88\u8d39\u65b9\u5f0f<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">1\u3001\u88ab\u52a8\u6d88\u8d39\u6a21\u5f0f<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\uff0cConsumer\u7b49\u5f85rabbitMQ \u670d\u52a1\u5668\u5c06message\u63a8\u9001\u8fc7\u6765\u518d\u6d88\u8d39\u3002\u4e00\u822c\u662f\u542f\u4e00\u4e2a\u4e00\u76f4\u6302\u8d77\u7684\u7ebf\u7a0b\u6765\u7b49\u5f85\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.basicConsume(String queue, boolean autoAck, Consumer callback);<\/code><\/pre>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5176\u4e2dautoAck\u662f\u4e2a\u5173\u952e\u3002autoAck\u4e3atrue\u5219\u8868\u793a\u6d88\u606f\u53d1\u9001\u5230\u8be5Consumer\u540e\u5c31\u88abConsumer\u6d88\u8d39\u6389\u4e86\uff0c\u4e0d\u9700\u8981\u518d\u5f80\u5176\u4ed6Consumer\u8f6c\u53d1\u3002\u4e3afalse\u5219\u4f1a\u7ee7\u7eed\u5f80\u5176\u4ed6Consumer\u8f6c\u53d1\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8981\u6ce8\u610f\u5982\u679c\u6bcf\u4e2aConsumer\u4e00\u76f4\u4e3afalse\uff0c\u4f1a\u5bfc\u81f4\u6d88\u606f\u4e0d\u505c\u7684\u88ab\u8f6c\u53d1\uff0c\u4e0d\u505c\u7684\u541e\u566c\u7cfb\u7edf\u8d44\u6e90\uff0c\u6700\u7ec8\u9020\u6210\u5b95\u673a\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">2\u3001\u53e6\u4e00\u79cd\u662f\u4e3b\u52a8\u6d88\u8d39\u6a21\u5f0f<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u3002Comsumer\u4e3b\u52a8\u5230rabbitMQ\u670d\u52a1\u5668\u4e0a\u53bb\u83b7\u53d6\u6307\u5b9a\u7684messge\u8fdb\u884c\u6d88\u8d39\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5173\u952e\u4ee3\u7801<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>GetResponse response = channel.basicGet(QUEUE_NAME, boolean autoAck);<\/code><\/pre>\n<p style=\"min-height: 24px;\"><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">3.Stream\u961f\u5217\u6d88\u8d39<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> <\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5728\u5f53\u524d\u7248\u672c\u4e0b\uff0c\u6d88\u8d39Stream\u961f\u5217\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4e09\u677f\u65a7\u7684\u8bbe\u7f6e\u3002<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">channel\u5fc5\u987b\u8bbe\u7f6ebasicQos\u5c5e\u6027\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6b63\u786e\u58f0\u660eStream\u961f\u5217\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6d88\u8d39\u65f6\u9700\u8981\u6307\u5b9aoffset\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5177\u4f53\u53c2\u770b\u793a\u4f8b\u4ee3\u7801\u3002\u6ce8\u610f\u5176\u4e2d\u7684\u6ce8\u91ca\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>Connection connection = RabbitMQUtil.getConnection();Channel channel = connection.createChannel();\/\/1\u3001\u8fd9\u4e2a\u5c5e\u6027\u5fc5\u987b\u8bbe\u7f6e\u3002channel.basicQos(100);\/\/2\u3001\u58f0\u660eStream\u961f\u5217Map&lt;String,Object&gt; params = new HashMap&lt;&gt;();params.put(\"x-queue-type\",\"stream\");params.put(\"x-max-length-bytes\", 20_000_000_000L); \/\/ maximum stream size: 20 GBparams.put(\"x-stream-max-segment-size-bytes\", 100_000_000); \/\/ size of segment files: 100 MBchannel.queueDeclare(QUEUE_NAME, true, false, false, params);\/\/Consumer\u63a5\u53e3\u8fd8\u4e00\u4e2a\u5b9e\u73b0QueueConsuemr \u4f46\u662f\u4ee3\u7801\u6ce8\u91ca\u8fc7\u671f\u4e86\u3002Consumer myconsumer = new DefaultConsumer(channel) {    @Override    public void handleDelivery(String consumerTag, Envelope envelope,                               AMQP.BasicProperties properties, byte[] body)            throws IOException {        System.out.println(\"========================\");        String routingKey = envelope.getRoutingKey();        System.out.println(\"routingKey &gt;\" + routingKey);        String contentType = properties.getContentType();        System.out.println(\"contentType &gt;\" + contentType);        long deliveryTag = envelope.getDeliveryTag();        System.out.println(\"deliveryTag &gt;\" + deliveryTag);        System.out.println(\"content:\" + new String(body, \"UTF-8\"));        \/\/ (process the message components here ...)        \/\/\u6d88\u606f\u5904\u7406\u5b8c\u540e\uff0c\u8fdb\u884c\u7b54\u590d\u3002\u7b54\u590d\u8fc7\u7684\u6d88\u606f\uff0c\u670d\u52a1\u5668\u5c31\u4e0d\u4f1a\u518d\u6b21\u8f6c\u53d1\u3002        \/\/\u6ca1\u6709\u7b54\u590d\u8fc7\u7684\u6d88\u606f\uff0c\u670d\u52a1\u5668\u4f1a\u4e00\u76f4\u4e0d\u505c\u8f6c\u53d1\u3002        channel.basicAck(deliveryTag, false);    }};\/\/3\u3001\u6d88\u8d39\u65f6\uff0c\u5fc5\u987b\u6307\u5b9aoffset\u3002 \u53ef\u9009\u7684\u503c\uff1a\/\/ first: \u4ece\u65e5\u5fd7\u961f\u5217\u4e2d\u7b2c\u4e00\u4e2a\u53ef\u6d88\u8d39\u7684\u6d88\u606f\u5f00\u59cb\u6d88\u8d39\/\/ last: \u6d88\u8d39\u6d88\u606f\u65e5\u5fd7\u4e2d\u6700\u540e\u4e00\u4e2a\u6d88\u606f\/\/ next: \u76f8\u5f53\u4e8e\u4e0d\u6307\u5b9aoffset\uff0c\u6d88\u8d39\u4e0d\u5230\u6d88\u606f\u3002\/\/ Offset: \u4e00\u4e2a\u6570\u5b57\u578b\u7684\u504f\u79fb\u91cf\/\/ Timestamp:\u4e00\u4e2a\u4ee3\u8868\u65f6\u95f4\u7684Data\u7c7b\u578b\u53d8\u91cf\uff0c\u8868\u793a\u4ece\u8fd9\u4e2a\u65f6\u95f4\u70b9\u5f00\u59cb\u6d88\u8d39\u3002\u4f8b\u5982 \u4e00\u4e2a\u5c0f\u65f6\u524d Date timestamp = new Date(System.currentTimeMillis() - 60 * 60 * 1_000)Map&lt;String,Object&gt; consumeParam = new HashMap&lt;&gt;();consumeParam.put(\"x-stream-offset\",\"next\");channel.basicConsume(QUEUE_NAME, false,consumeParam, myconsumer);channel.close();<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u8fd9\u4e09\u70b9\u8981\u5c24\u5176\u6ce8\u610f\uff0c\u56e0\u4e3a\u5f53\u524d\u7248\u672c\u7684\u9519\u8bef\u63d0\u793a\u975e\u5e38\u8ba9\u4eba\u7740\u6025\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">step5\u3001\u5b8c\u6210\u4ee5\u540e\u5173\u95ed\u8fde\u63a5\uff0c\u91ca\u653e\u8d44\u6e90<\/span><\/h4>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.close();<\/code><\/pre>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">9.1.3.\u5b98\u7f51\u7684\u6d88\u606f\u573a\u666f<\/h3>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u539f\u751fAPI\u91cd\u70b9\u5c31\u662f\u5b66\u4e60\u5e76\u7406\u89e3RabbitMQ\u7684\u5b98\u65b9\u6d88\u606f\u6a21\u578b\u3002\u5177\u4f53\u53c2\u89c1<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> <\/span>https:\/\/www.rabbitmq.com\/getstarted.html<span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> <\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u3002\u5176\u4e2d\u53ef\u4ee5\u770b\u5230\uff0cRabbitMQ\u5b98\u65b9\u63d0\u4f9b\u4e86\u603b\u5171\u4e03\u79cd\u6d88\u606f\u6a21\u578b\uff0c\u8fd9\u5176\u4e2d\uff0c6 RPC\u90e8\u5206\u662f\u4f7f\u7528RabbitMQ\u6765\u5b9e\u73b0RPC\u8fdc\u7a0b\u8c03\u7528\uff0c\u8fd9\u4e2a\u573a\u666f\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528MQ\u6765\u5b9e\u73b0\uff0c\u6240\u4ee5\u4e5f\u5c31\u4e0d\u5f53\u4f5c\u91cd\u70b9\u6765\u5b66\u4e60\u3002\u800c7 Publisher Confirms\u662f\u5f53\u524d\u7248\u672c\u65b0\u5f15\u8fdb\u6765\u7684\u4e00\u79cd\u6d88\u606f\u6a21\u578b\uff0c\u5bf9\u4fdd\u62a4\u6d88\u606f\u53ef\u9760\u6027\u6709\u5f88\u91cd\u8981\u7684\u610f\u4e49\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e9b\u6d88\u606f\u6a21\u578b\u57fa\u672c\u4e0a\u6db5\u76d6\u4e86\u65e5\u5e38\u5f00\u53d1\u4e2d\u7684\u7edd\u5927\u90e8\u5206\u573a\u666f\uff0c\u800c\u5bf9\u4e8e\u4ed6\u4eec\u7684API\u4f7f\u7528\uff0c\u5176\u5b9e\u90fd\u662f\u5927\u540c\u5c0f\u5f02\uff0c\u975e\u5e38\u5bb9\u6613\u4e0a\u624b\uff0c\u5e76\u4e14\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u4e00\u822c\u4e5f\u6709\u5176\u4ed6\u66f4\u597d\u7684\u6846\u67b6\u6765\u6574\u5408RabbitMQ\u4f7f\u7528 \u3002\u6240\u4ee5\u5bf9\u8fd9\u4e00\u90e8\u5206\u7684\u5b66\u4e60\uff0c\u7406\u89e3\u4e1a\u52a1\u573a\u666f\u662f\u6700\u4e3a\u91cd\u8981\u7684\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000880\" data-ratio=\"0.7769869513641756\"  data-type=\"png\" data-w=\"843\" width=\"721.4000244140625\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224325937.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000880\" data-ratio=\"0.7769869513641756\"  data-type=\"png\" data-w=\"843\" width=\"721.4000244140625\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224325937.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000883\" data-ratio=\"1.040332147093713\"  data-type=\"png\" data-w=\"843\" width=\"719.4000244140625\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224329247.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000883\" data-ratio=\"1.040332147093713\"  data-type=\"png\" data-w=\"843\" width=\"719.4000244140625\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224329247.png\"  \/><\/noscript><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">9.1.3.1.hello world\u521d\u4f53\u9a8c<\/h4>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000879\" data-ratio=\"0.30677290836653387\"  data-type=\"png\" data-w=\"251\" width=\"494.8000030517578\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224333536.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000879\" data-ratio=\"0.30677290836653387\"  data-type=\"png\" data-w=\"251\" width=\"494.8000030517578\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224333536.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6700\u76f4\u63a5\u7684\u65b9\u5f0f\uff0cP\u7aef\u53d1\u9001\u4e00\u4e2a\u6d88\u606f\u5230\u4e00\u4e2a\u6307\u5b9a\u7684queue\uff0c\u4e2d\u95f4\u4e0d\u9700\u8981\u4efb\u4f55exchange\u89c4\u5219\u3002C\u7aef\u6309queue\u65b9\u5f0f\u8fdb\u884c\u6d88\u8d39\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5173\u952e\u4ee3\u7801\uff1a(\u5176\u5b9e\u5173\u952e\u7684\u533a\u522b\u4e5f\u5c31\u662f\u51e0\u4e2a\u58f0\u660e\u4e0a\u7684\u4e0d\u540c\u3002)<\/span><\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">producer:<\/span><\/h5>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.queueDeclare(QUEUE_NAME,false,false,false,null);channel.basicPublish(\"\", QUEUE_NAME, null, message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">consumer<\/span><\/h5>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.queueDeclare(QUEUE_NAME, false, false, false, null);<\/code><\/pre>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\">9.1.3.2.<span style=\"color: rgb(51, 51, 51);\">Work queues \u5de5\u4f5c\u5e8f\u5217<\/span><\/h4>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000887\" data-ratio=\"0.5572519083969466\"  data-type=\"png\" data-w=\"262\" width=\"504.6000061035156\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224336336.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000887\" data-ratio=\"0.5572519083969466\"  data-type=\"png\" data-w=\"262\" width=\"504.6000061035156\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224336336.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5de5\u4f5c\u4efb\u52a1\u6a21\u5f0f\uff0c\u9886\u5bfc\u90e8\u7f72\u4e00\u4e2a\u4efb\u52a1\uff0c\u7531\u4e0b\u9762\u7684\u4e00\u4e2a\u5458\u5de5\u6765\u5904\u7406\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">producer:<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.queueDeclare(TASK_QUEUE_NAME, true, false, false, null); \/\/\u4efb\u52a1\u4e00\u822c\u662f\u4e0d\u80fd\u56e0\u4e3a\u6d88\u606f\u4e2d\u95f4\u4ef6\u7684\u670d\u52a1\u800c\u88ab\u803d\u8bef\u7684\uff0c\u6240\u4ee5durable\u8bbe\u7f6e\u6210\u4e86true\uff0c\u8fd9\u6837\uff0c\u5373\u4f7frabbitMQ\u670d\u52a1\u65ad\u4e86\uff0c\u8fd9\u4e2a\u6d88\u606f\u4e5f\u4e0d\u4f1a\u6d88\u5931channel.basicPublish(\"\", TASK_QUEUE_NAME,MessageProperties.PERSISTENT_TEXT_PLAIN,        message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Consumer:<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.queueDeclare(TASK_QUEUE_NAME, true, false, false, null);channel.basicQos(1);channel.basicConsume(TASK_QUEUE_NAME, false, consumer);<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e2a\u6a21\u5f0f\u5e94\u8be5\u662f\u6700\u5e38\u7528\u7684\u6a21\u5f0f\uff0c\u4e5f\u662f\u5b98\u7f51\u8ba8\u8bba\u6bd4\u8f83\u8be6\u7ec6\u7684\u4e00\u79cd\u6a21\u5f0f\uff0c\u6240\u4ee5\u5b98\u7f51\u4e0a\u4e5f\u5bf9\u8fd9\u79cd\u6a21\u5f0f\u505a\u4e86\u91cd\u70b9\u8bb2\u8ff0\u3002<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u9996\u5148\u3002Consumer\u7aef\u7684autoAck\u5b57\u6bb5\u8bbe\u7f6e\u7684\u662ffalse,\u8fd9\u8868\u793aconsumer\u5728\u63a5\u6536\u5230\u6d88\u606f\u540e\u4e0d\u4f1a\u81ea\u52a8\u53cd\u9988\u670d\u52a1\u5668\u5df2\u6d88\u8d39\u4e86message\uff0c\u800c\u8981\u6539\u5728\u5bf9message\u5904\u7406\u5b8c\u6210\u4e86\u4e4b\u540e\uff0c\u518d\u8c03\u7528channel.basicAck\u6765\u901a\u77e5\u670d\u52a1\u5668\u5df2\u7ecf\u6d88\u8d39\u4e86\u8be5message.\u8fd9\u6837\u5373\u4f7fConsumer\u5728\u6267\u884cmessage\u8fc7\u7a0b\u4e2d\u51fa\u95ee\u9898\u4e86\uff0c\u4e5f\u4e0d\u4f1a\u9020\u6210message\u88ab\u5ffd\u7565\uff0c\u56e0\u4e3a\u6ca1\u6709ack\u7684message\u4f1a\u88ab\u670d\u52a1\u5668\u91cd\u65b0\u8fdb\u884c\u6295\u9012\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f46\u662f\uff0c\u8fd9\u5176\u4e2d\u4e5f\u8981\u6ce8\u610f\u4e00\u4e2a\u5f88\u5e38\u89c1\u7684BUG\uff0c\u5c31\u662f\u5982\u679c\u6240\u6709\u7684consumer\u90fd\u5fd8\u8bb0\u8c03\u7528basicAck()\u4e86\uff0c\u5c31\u4f1a\u9020\u6210message\u88ab\u4e0d\u505c\u7684\u5206\u53d1\uff0c\u4e5f\u5c31\u9020\u6210\u4e0d\u65ad\u7684\u6d88\u8017\u7cfb\u7edf\u8d44\u6e90\u3002\u8fd9\u4e5f\u5c31\u662f Poison Message(\u6bd2\u6d88\u606f)<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5176\u6b21\uff0c\u5b98\u65b9\u7279\u610f\u63d0\u5230\u7684message\u7684\u6301\u4e45\u6027\u3002\u5173\u952e\u7684message\u4e0d\u80fd\u56e0\u4e3a\u670d\u52a1\u51fa\u73b0\u95ee\u9898\u800c\u88ab\u5ffd\u7565\u3002\u8fd8\u8981\u6ce8\u610f\uff0c\u5b98\u65b9\u7279\u610f\u63d0\u5230\uff0c\u6240\u6709\u7684queue\u662f\u4e0d\u80fd\u88ab\u591a\u6b21\u5b9a\u4e49\u7684\u3002\u5982\u679c\u4e00\u4e2aqueue\u5728\u5f00\u59cb\u65f6\u88ab\u58f0\u660e\u4e3adurable\uff0c\u90a3\u5728\u540e\u9762\u518d\u6b21\u58f0\u660e\u8fd9\u4e2aqueue\u65f6\uff0c\u5373\u4f7f\u58f0\u660e\u4e3a not durable\uff0c\u90a3\u8fd9\u4e2aqueue\u7684\u7ed3\u679c\u4e5f\u8fd8\u662fdurable\u7684\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7136\u540e\uff0c\u662f\u4e2d\u95f4\u4ef6\u6700\u4e3a\u5173\u952e\u7684\u5206\u53d1\u65b9\u5f0f\u3002\u8fd9\u91cc\uff0cRabbitMQ\u9ed8\u8ba4\u662f\u91c7\u7528\u7684fair dispatch\uff0c\u4e5f\u53ebround-robin\u6a21\u5f0f\uff0c\u5c31\u662f\u628a\u6d88\u606f\u8f6e\u8be2\uff0c\u5728\u6240\u6709consumer\u4e2d\u8f6e\u6d41\u53d1\u9001\u3002\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6ca1\u6709\u8003\u8651\u6d88\u606f\u5904\u7406\u7684\u590d\u6742\u5ea6\u4ee5\u53caconsumer\u7684\u5904\u7406\u80fd\u529b\u3002\u800c\u4ed6\u4eec\u6539\u8fdb\u540e\u7684\u65b9\u6848\uff0c\u662fconsumer\u53ef\u4ee5\u5411\u670d\u52a1\u5668\u58f0\u660e\u4e00\u4e2aprefetchCount\uff0c\u6211\u628a\u4ed6\u53eb\u505a\u9884\u5904\u7406\u80fd\u529b\u503c\u3002channel.basicQos(prefetchCount);\u8868\u793a\u5f53\u524d\u8fd9\u4e2aconsumer\u53ef\u4ee5\u540c\u65f6\u5904\u7406\u51e0\u4e2amessage\u3002\u8fd9\u6837\u670d\u52a1\u5668\u5728\u8fdb\u884c\u6d88\u606f\u53d1\u9001\u524d\uff0c\u4f1a\u68c0\u67e5\u8fd9\u4e2aconsumer\u5f53\u524d\u6b63\u5728\u5904\u7406\u4e2d\u7684message(message\u5df2\u7ecf\u53d1\u9001\uff0c\u4f46\u662f\u672a\u6536\u5230consumer\u7684basicAck)\u6709\u51e0\u4e2a\uff0c\u5982\u679c\u8d85\u8fc7\u4e86\u8fd9\u4e2aconsumer\u8282\u70b9\u7684\u80fd\u529b\u503c\uff0c\u5c31\u4e0d\u518d\u5f80\u8fd9\u4e2aconsumer\u53d1\u5e03\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u79cd\u6a21\u5f0f\uff0c\u5b98\u65b9\u4e5f\u6307\u51fa\u8fd8\u662f\u6709\u95ee\u9898\u7684\uff0c\u6d88\u606f\u6709\u53ef\u80fd\u5168\u90e8\u963b\u585e\uff0c\u6240\u6709consumer\u8282\u70b9\u90fd\u8d85\u8fc7\u4e86\u80fd\u529b\u503c\uff0c\u90a3\u6d88\u606f\u5c31\u963b\u585e\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u8fd9\u65f6\u9700\u8981\u81ea\u5df1\u53ca\u65f6\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\uff0c\u91c7\u53d6\u63aa\u65bd\uff0c\u6bd4\u5982\u589e\u52a0consumer\u8282\u70b9\u6216\u8005\u5176\u4ed6\u7b56\u7565<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u53e6\u5916 \u5b98\u7f51\u4e0a\u6ca1\u6709\u6df1\u5165\u63d0\u5230\u7684\uff0c\u5c31\u662f\u8fd8\u662f\u6ca1\u6709\u8003\u8651\u5230message\u5904\u7406\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u6709\u7684message\u5904\u7406\u53ef\u80fd\u5f88\u7b80\u5355\uff0c\u6709\u7684\u53ef\u80fd\u5f88\u590d\u6742\uff0c\u73b0\u5728\u8fd8\u662f\u5c06\u6240\u6709message\u7684\u5904\u7406\u7a0b\u5ea6\u5f53\u6210\u4e00\u6837\u7684\u3002\u8fd8\u662f\u6709\u7f3a\u9677\u7684\uff0c\u4f46\u662f\u76ee\u524d\u4e5f\u53ea\u770b\u5230dubbo\u91cc\u5bf9\u5355\u4e2a\u670d\u52a1\u6709\u6743\u91cd\u503c\u7684\u6982\u5ff5\uff0c\u6d89\u53ca\u5230\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.3.3.Publish\/Subscribe \u8ba2\u9605 \u53d1\u5e03 \u673a\u5236<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">type\u4e3a<\/span><strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">fanout<\/span><\/strong><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> \u7684exchange\uff1a<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100000886\" data-ratio=\"0.528169014084507\"  data-type=\"png\" data-w=\"284\" width=\"486.1999969482422\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224339899.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100000886\" data-ratio=\"0.528169014084507\"  data-type=\"png\" data-w=\"284\" width=\"486.1999969482422\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224339899.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e2a\u673a\u5236\u662f\u5bf9\u4e0a\u9762\u7684\u4e00\u79cd\u8865\u5145\u3002\u4e5f\u5c31\u662f\u628apreducer\u4e0eConsumer\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u89e3\u8026\u3002producer\u53ea\u8d1f\u8d23\u53d1\u9001\u6d88\u606f\uff0c\u81f3\u4e8e\u6d88\u606f\u8fdb\u5165\u54ea\u4e2aqueue\uff0c\u7531exchange\u6765\u5206\u914d\u3002\u5982\u4e0a\u56fe\uff0c\u5c31\u662f\u628aproducer\u53d1\u9001\u7684\u6d88\u606f\uff0c\u4ea4\u7531exchange\u540c\u65f6\u53d1\u9001\u5230\u4e24\u4e2aqueue\u91cc\uff0c\u7136\u540e\u7531\u4e0d\u540c\u7684Consumer\u53bb\u8fdb\u884c\u6d88\u8d39\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5173\u952e\u4ee3\u7801 ===\u300b producer: \/\/\u53ea\u8d1f\u8d23\u5f80exchange\u91cc\u53d1\u6d88\u606f\uff0c\u540e\u9762\u7684\u4e8b\u60c5\u4e0d\u7ba1\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"fanout\");channel.basicPublish(EXCHANGE_NAME, \"\", null, message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">receiver: \/\/\u5c06\u6d88\u8d39\u7684\u76ee\u6807\u961f\u5217\u7ed1\u5b9a\u5230exchange\u4e0a\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"fanout\");String queueName = channel.queueDeclare().getQueue();channel.queueBind(queueName, EXCHANGE_NAME, \"\");<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5173\u952e\u5904\u5c31\u662ftype\u4e3a\u201dfanout\u201d \u7684exchange,\u8fd9\u79cd\u7c7b\u578b\u7684exchange\u53ea\u8d1f\u8d23\u5f80\u6240\u6709\u5df2\u7ed1\u5b9a\u7684\u961f\u5217\u4e0a\u53d1\u9001\u6d88\u606f\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.3.4.Routing \u57fa\u4e8e\u5185\u5bb9\u7684\u8def\u7531<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">type\u4e3a\u201ddirect\u201d \u7684exchange<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000885\" data-ratio=\"0.6379928315412187\"  data-type=\"png\" data-w=\"279\" width=\"533.1999969482422\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224342524.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000885\" data-ratio=\"0.6379928315412187\"  data-type=\"png\" data-w=\"279\" width=\"533.1999969482422\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224342524.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u79cd\u6a21\u5f0f\u4e00\u770b\u56fe\u5c31\u6e05\u6670\u4e86\u3002 \u5728\u4e0a\u4e00\u7ae0 exchange \u5f80\u6240\u6709\u961f\u5217\u53d1\u9001\u6d88\u606f\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u4e00\u4e2a\u8def\u7531\u914d\u7f6e\uff0c\u6307\u5b9aexchange\u5982\u4f55\u5c06\u4e0d\u540c\u7c7b\u522b\u7684\u6d88\u606f\u5206\u53d1\u5230\u4e0d\u540c\u7684queue\u4e0a\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Producer:<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"direct\");channel.basicPublish(EXCHANGE_NAME, routingKey, null, message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Receiver:<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"direct\");channel.queueBind(queueName, EXCHANGE_NAME, routingKey1);channel.queueBind(queueName, EXCHANGE_NAME, routingKey2);channel.basicConsume(queueName, true, consumer);<\/code><\/pre>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.3.5.Topics \u8bdd\u9898<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">type\u4e3a\"topic\" \u7684exchange<\/span><\/p>\n<p style=\"min-height: 24px;\"><img decoding=\"async\" class=\"lazyload\"data-imgfileid=\"100000884\" data-ratio=\"0.5357142857142857\"  data-type=\"png\" data-w=\"280\" width=\"563\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224345509.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-imgfileid=\"100000884\" data-ratio=\"0.5357142857142857\"  data-type=\"png\" data-w=\"280\" width=\"563\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224345509.png\"  \/><\/noscript><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u4e2a\u6a21\u5f0f\u4e5f\u5c31\u5728\u4e0a\u4e00\u4e2a\u6a21\u5f0f\u7684\u57fa\u7840\u4e0a\uff0c\u5bf9routingKey\u8fdb\u884c\u4e86\u6a21\u7cca\u5339\u914d<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5355\u8bcd\u4e4b\u95f4\u7528,\u9694\u5f00\uff0c* \u4ee3\u8868\u4e00\u4e2a\u5177\u4f53\u7684\u5355\u8bcd\u3002# \u4ee3\u88680\u4e2a\u6216\u591a\u4e2a\u5355\u8bcd\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Producer:<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"topic\");channel.basicPublish(EXCHANGE_NAME, routingKey, null, message.getBytes(\"UTF-8\"));<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">Receiver<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.exchangeDeclare(EXCHANGE_NAME, \"topic\");channel.queueBind(queueName, EXCHANGE_NAME, routingKey1);channel.queueBind(queueName, EXCHANGE_NAME, routingKey2);channel.basicConsume(queueName, true, consumer);<\/code><\/pre>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.3.6.RPC \u8fdc\u7a0b\u8c03\u7528<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fdc\u7a0b\u8c03\u7528\u662f\u540c\u6b65\u963b\u585e\u7684\u8c03\u7528\u8fdc\u7a0b\u670d\u52a1\u5e76\u83b7\u53d6\u7ed3\u679c\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RPC\u8fdc\u7a0b\u8c03\u7528\u673a\u5236\u5176\u5b9e\u5e76\u4e0d\u662f\u6d88\u606f\u4e2d\u95f4\u4ef6\u7684\u5904\u7406\u5f3a\u9879\u3002\u6bd5\u7adf\u6d88\u606f\u961f\u5217\u673a\u5236\u5f88\u5927\u7a0b\u5ea6\u4e0a\u6765\u8bf4\u5c31\u662f\u4e3a\u4e86\u7f13\u51b2\u540c\u6b65RPC\u8c03\u7528\u9020\u6210\u7684\u77ac\u95f4\u9ad8\u5cf0\u3002\u800cRabbitMQ\u7684\u540c\u6b65\u8c03\u7528\u793a\u4f8b\uff0c\u770b\u7740\u4e5f\u786e\u5b9e\u602a\u602a\u7684\u3002\u5e76\u4e14\uff0cRPC\u8fdc\u7a0b\u8c03\u7528\u7684\u573a\u666f\uff0c\u4e5f\u6709\u592a\u591a\u53ef\u66ff\u4ee3\u7684\u6280\u672f\u4f1a\u6bd4\u7528\u6d88\u606f\u4e2d\u95f4\u4ef6\u5904\u7406\u5f97\u66f4\u4f18\u96c5\uff0c\u66f4\u6d41\u7545\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>A note on RPCAlthough RPC is a pretty common pattern in computing, it\u2019s often criticised. The problems arise when a programmer is not aware whether a function call is local or if it\u2019s a slow RPC. Confusions like that result in an unpredictable system and adds unnecessary complexity to debugging. Instead of simplifying software, misused RPC can result in unmaintainable spaghetti code.Bearing that in mind, consider the following advice:\u25cf Make sure it\u2019s obvious which function call is local and which is remote.\u25cf Document your system. Make the dependencies between components clear.\u25cf Handle error cases. How should the client react when the RPC server is down for a long time?When in doubt avoid RPC. If you can, you should use an asynchronous pipeline - instead of RPC-like blocking, results are asynchronously pushed to a next computation stage.<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5b98\u7f51\u4e0a\u8fd9\u4e00\u5927\u5806\u8bf4\u660e\uff0c\u5176\u5b9e\u6211\u89c9\u5f97\u5c31\u662f\u8868\u660e\uff0c\u53eb\u4f60\u4e0d\u8981\u7528\u6d88\u606f\u4e2d\u95f4\u4ef6\u6765\u505aRPC\u3002\u6240\u4ee5\u5173\u4e8e\u8fd9\u4e2aRPC\u8c03\u7528\u529f\u80fd\uff0c\u5c31\u4e0d\u518d\u591a\u505a\u89e3\u91ca\u4e86\u3002\u4ee3\u7801\u5b9e\u73b0\u53ef\u4ee5\u53c2\u89c1\u5b98\u7f51\uff0c\u6216\u8005\u914d\u5957\u7684\u793a\u4f8b\u4ee3\u7801\u3002<\/span><\/p>\n<h4 style=\"line-height: 24px;margin-top: 10px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.1.3.7\uff1aPublisher Confirms \u53d1\u9001\u8005\u6d88\u606f\u786e\u8ba4<\/span><\/h4>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">RabbitMQ\u7684\u6d88\u606f\u53ef\u9760\u6027\u662f\u975e\u5e38\u9ad8\u7684\uff0c\u4f46\u662f\u4ed6\u4ee5\u5f80\u7684\u673a\u5236\u90fd\u662f\u4fdd\u8bc1\u6d88\u606f\u53d1\u9001\u5230\u4e86MQ\u4e4b\u540e\uff0c\u53ef\u4ee5\u63a8\u9001\u5230\u6d88\u8d39\u8005\u6d88\u8d39\uff0c\u4e0d\u4f1a\u4e22\u5931\u6d88\u606f\u3002\u4f46\u662f\u53d1\u9001\u8005\u53d1\u9001\u6d88\u606f\u662f\u5426\u6210\u529f\u662f\u6ca1\u6709\u4fdd\u8bc1\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u56de\u987e\u4e0b\uff0c\u53d1\u9001\u8005\u53d1\u9001\u6d88\u606f\u7684\u57fa\u7840API\uff1aProducer.basicPublish\u65b9\u6cd5\u662f\u6ca1\u6709\u8fd4\u56de\u503c\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e00\u6b21\u53d1\u9001\u6d88\u606f\u662f\u5426\u6210\u529f\uff0c\u5e94\u7528\u662f\u4e0d\u77e5\u9053\u7684\uff0c\u8fd9\u5728\u4e1a\u52a1\u4e0a\u5c31\u5bb9\u6613\u9020\u6210\u6d88\u606f\u4e22\u5931\u3002\u800c\u8fd9\u4e2a\u6a21\u5757\u5c31\u662f\u901a\u8fc7\u7ed9\u53d1\u9001\u8005\u63d0\u4f9b\u4e00\u4e9b\u786e\u8ba4\u673a\u5236\uff0c\u6765\u4fdd\u8bc1\u8fd9\u4e2a\u6d88\u606f\u53d1\u9001\u7684\u8fc7\u7a0b\u662f\u6210\u529f\u7684\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5982\u679c\u4e86\u89e3\u4e86\u8fd9\u4e2a\u673a\u5236\u5c31\u4f1a\u53d1\u73b0\uff0c\u8fd9\u4e2a\u6d88\u606f\u786e\u8ba4\u673a\u5236\u5c31\u662f\u8ddfRocketMQ\u7684\u4e8b\u52a1\u6d88\u606f\u673a\u5236\u5dee\u4e0d\u591a\u7684\u3002\u800c\u5bf9\u4e8e\u8fd9\u4e2a\u673a\u5236\uff0cRocketMQ\u7684\u652f\u6301\u660e\u663e\u66f4\u4f18\u96c5\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u53d1\u9001\u8005\u786e\u8ba4\u6a21\u5f0f\u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u5f00\u542f\u53d1\u9001\u8005\u786e\u8ba4\u6a21\u5f0f\uff0c\u9700\u8981\u624b\u52a8\u5728channel\u4e2d\u8fdb\u884c\u58f0\u660e\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.confirmSelect();<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5728\u5b98\u7f51\u7684\u793a\u4f8b\u4e2d\uff0c\u91cd\u70b9\u89e3\u91ca\u4e86\u4e09\u79cd\u7b56\u7565\uff1a<\/span><\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">1\u3001\u53d1\u5e03\u5355\u6761\u6d88\u606f<\/span><\/h5>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5373\u53d1\u5e03\u4e00\u6761\u6d88\u606f\u5c31\u786e\u8ba4\u4e00\u6761\u6d88\u606f\u3002\u6838\u5fc3\u4ee3\u7801\uff1a<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>for (int i = 0; i &lt; MESSAGE_COUNT; i++) {    String body = String.valueOf(i);    channel.basicPublish(\"\", queue, null, body.getBytes());    channel.waitForConfirmsOrDie(5_000);}<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> channel.waitForConfirmsOrDie(5_000);\u8fd9\u4e2a\u65b9\u6cd5\u5c31\u4f1a\u5728channel\u7aef\u7b49\u5f85RabbitMQ\u7ed9\u51fa\u4e00\u4e2a\u54cd\u5e94\uff0c\u7528\u6765\u8868\u660e\u8fd9\u4e2a\u6d88\u606f\u5df2\u7ecf\u6b63\u786e\u53d1\u9001\u5230\u4e86RabbitMQ\u670d\u52a1\u7aef\u3002\u4f46\u662f\u8981\u6ce8\u610f\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u4f1a\u540c\u6b65\u963b\u585echannel\uff0c\u5728\u7b49\u5f85\u786e\u8ba4\u671f\u95f4\uff0cchannel\u5c06\u4e0d\u80fd\u518d\u7ee7\u7eed\u53d1\u9001\u6d88\u606f\uff0c\u4e5f\u5c31\u662f\u8bf4\u4f1a\u660e\u663e\u964d\u4f4e\u96c6\u7fa4\u7684\u53d1\u9001\u901f\u5ea6\u5373\u541e\u5410\u91cf\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5b98\u65b9\u8bf4\u660e\u4e86\uff0c\u5176\u5b9echannel\u5e95\u5c42\u662f\u5f02\u6b65\u5de5\u4f5c\u7684\uff0c\u4f1a\u5c06channel\u963b\u585e\u4f4f\uff0c\u7136\u540e\u5f02\u6b65\u7b49\u5f85\u670d\u52a1\u7aef\u53d1\u9001\u4e00\u4e2a\u786e\u8ba4\u6d88\u606f\uff0c\u624d\u89e3\u9664\u963b\u585e\u3002\u4f46\u662f\u6211\u4eec\u5728\u4f7f\u7528\u65f6\uff0c\u53ef\u4ee5\u628a\u4ed6\u5f53\u4f5c\u4e00\u4e2a\u540c\u6b65\u5de5\u5177\u6765\u770b\u5f85\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u7136\u540e\u5982\u679c\u5230\u4e86\u8d85\u65f6\u65f6\u95f4\uff0c\u8fd8\u6ca1\u6709\u6536\u5230\u670d\u52a1\u7aef\u7684\u786e\u8ba4\u673a\u5236\uff0c\u90a3\u5c31\u4f1a\u629b\u51fa\u5f02\u5e38\u3002\u7136\u540e\u901a\u5e38\u5904\u7406\u8fd9\u4e2a\u5f02\u5e38\u7684\u65b9\u5f0f\u662f\u8bb0\u5f55\u9519\u8bef\u65e5\u5fd7\u6216\u8005\u5c1d\u8bd5\u91cd\u53d1\u6d88\u606f\uff0c\u4f46\u662f\u5c1d\u8bd5\u91cd\u53d1\u65f6\u4e00\u5b9a\u8981\u6ce8\u610f\u4e0d\u8981\u4f7f\u7a0b\u5e8f\u9677\u5165\u6b7b\u5faa\u73af\u3002<\/span><\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">2\u3001\u53d1\u9001\u6279\u91cf\u6d88\u606f<\/span><\/h5>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4e4b\u524d\u5355\u6761\u786e\u8ba4\u7684\u673a\u5236\u4f1a\u5bf9\u7cfb\u7edf\u7684\u541e\u5410\u91cf\u9020\u6210\u5f88\u5927\u7684\u5f71\u54cd\uff0c\u6240\u4ee5\u7a0d\u5fae\u4e2d\u548c\u4e00\u70b9\u7684\u65b9\u5f0f\u5c31\u662f\u53d1\u9001\u4e00\u6279\u6d88\u606f\u540e\uff0c\u518d\u4e00\u8d77\u786e\u8ba4\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6838\u5fc3\u4ee3\u7801\uff1a<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>int batchSize = 100;int outstandingMessageCount = 0;long start = System.nanoTime();for (int i = 0; i &lt; MESSAGE_COUNT; i++) {    String body = String.valueOf(i);    ch.basicPublish(\"\", queue, null, body.getBytes());    outstandingMessageCount++;    if (outstandingMessageCount == batchSize) {       ch.waitForConfirmsOrDie(5_000);       outstandingMessageCount = 0;    }}if (outstandingMessageCount &gt; 0) {    ch.waitForConfirmsOrDie(5_000);}<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u7a0d\u5fae\u7f13\u89e3\u4e0b\u53d1\u9001\u8005\u786e\u8ba4\u6a21\u5f0f\u5bf9\u541e\u5410\u91cf\u7684\u5f71\u54cd\u3002\u4f46\u662f\u4e5f\u6709\u4e2a\u56fa\u6709\u7684\u95ee\u9898\u5c31\u662f\uff0c\u5f53\u786e\u8ba4\u51fa\u73b0\u5f02\u5e38\u65f6\uff0c\u53d1\u9001\u8005\u53ea\u80fd\u77e5\u9053\u662f\u8fd9\u4e00\u6279\u6d88\u606f\u51fa\u95ee\u9898\u4e86\uff0c \u800c\u65e0\u6cd5\u786e\u8ba4\u5177\u4f53\u662f\u54ea\u4e00\u6761\u6d88\u606f\u51fa\u4e86\u95ee\u9898\u3002\u6240\u4ee5\u63a5\u4e0b\u6765\u5c31\u9700\u8981\u589e\u52a0\u4e00\u4e2a\u673a\u5236\u80fd\u591f\u5177\u4f53\u5bf9\u6bcf\u4e00\u6761\u53d1\u9001\u51fa\u9519\u7684\u6d88\u606f\u8fdb\u884c\u5904\u7406\u3002<\/span><\/p>\n<h5 style=\"font-size: 15px;line-height: 24px;margin-top: 8px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">3\u3001\u5f02\u6b65\u786e\u8ba4\u6d88\u606f<\/span><\/h5>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> \u5b9e\u73b0\u7684\u65b9\u5f0f\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0cProducer\u5728channel\u4e2d\u6ce8\u518c\u76d1\u542c\u5668\u6765\u5bf9\u6d88\u606f\u8fdb\u884c\u786e\u8ba4\u3002\u6838\u5fc3\u4ee3\u7801\u5c31\u662f\u4e00\u4e2a\uff1a<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>channel.addConfirmListener(ConfirmCallback var1, ConfirmCallback var2);<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6309\u8bf4\u76d1\u542c\u53ea\u8981\u6ce8\u518c\u4e00\u4e2a\u5c31\u53ef\u4ee5\u4e86\uff0c\u90a3\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u8981\u6ce8\u518c\u4e24\u4e2a\u5462\uff1f\u5982\u679c\u5bf9\u7167\u4e0bRocketMQ\u7684\u4e8b\u52a1\u6d88\u606f\u673a\u5236\uff0c\u8fd9\u5c31\u5f88\u5bb9\u6613\u7406\u89e3\u4e86\u3002\u53d1\u9001\u8005\u5728\u53d1\u9001\u5b8c\u6d88\u606f\u540e\uff0c\u5c31\u4f1a\u6267\u884c\u7b2c\u4e00\u4e2a\u76d1\u542c\u5668callback1\uff0c\u7136\u540e\u7b49\u670d\u52a1\u7aef\u53d1\u8fc7\u6765\u7684\u53cd\u9988\u540e\uff0c\u518d\u6267\u884c\u7b2c\u4e8c\u4e2a\u76d1\u542c\u5668callback2\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7136\u540e\u5173\u4e8e\u8fd9\u4e2aConfirmCallback\uff0c\u8fd9\u662f\u4e2a\u76d1\u542c\u5668\u63a5\u53e3\uff0c\u91cc\u9762\u53ea\u6709\u4e00\u4e2a\u65b9\u6cd5\uff1a void handle(long sequenceNumber, boolean multiple) throws IOException; \u8fd9\u65b9\u6cd5\u4e2d\u7684\u4e24\u4e2a\u53c2\u6570\uff0c<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">sequenceNumer\uff1a\u8fd9\u4e2a\u662f\u4e00\u4e2a\u552f\u4e00\u7684\u5e8f\u5217\u53f7\uff0c\u4ee3\u8868\u4e00\u4e2a\u552f\u4e00\u7684\u6d88\u606f\u3002\u5728RabbitMQ\u4e2d\uff0c\u4ed6\u7684\u6d88\u606f\u4f53\u53ea\u662f\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6570\u7ec4\uff0c\u5e76\u4e0d\u50cfRocketMQ\u4e00\u6837\u6709\u4e00\u4e2a\u5c01\u88c5\u7684\u5bf9\u8c61\uff0c\u6240\u4ee5\u9ed8\u8ba4\u6d88\u606f\u662f\u6ca1\u6709\u5e8f\u5217\u53f7\u7684\u3002\u800cRabbitMQ\u63d0\u4f9b\u4e86\u4e00\u4e2a\u65b9\u6cd5<\/span><span style=\"color: rgb(51, 51, 51);font-size: 12px;\">int sequenceNumber = channel.getNextPublishSeqNo());<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6765\u751f\u6210\u4e00\u4e2a\u5168\u5c40\u9012\u589e\u7684\u5e8f\u5217\u53f7\u3002\u7136\u540e\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u81ea\u5df1\u6765\u5c06\u8fd9\u4e2a\u5e8f\u5217\u53f7\u4e0e\u6d88\u606f\u5bf9\u5e94\u8d77\u6765\u3002<\/span><span style=\"color: rgb(51, 51, 51);font-size: 12px;\">\u6ca1\u9519\uff01\u662f\u7684\uff01\u9700\u8981\u5ba2\u6237\u7aef\u81ea\u5df1\u53bb\u505a\u5bf9\u5e94\uff01<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">multiple\uff1a\u8fd9\u4e2a\u662f\u4e00\u4e2aBoolean\u578b\u7684\u53c2\u6570\u3002\u5982\u679c\u662ffalse\uff0c\u5c31\u8868\u793a\u8fd9\u4e00\u6b21\u53ea\u786e\u8ba4\u4e86\u5f53\u524d\u4e00\u6761\u6d88\u606f\u3002\u5982\u679c\u662ftrue\uff0c\u5c31\u8868\u793aRabbitMQ\u8fd9\u4e00\u6b21\u786e\u8ba4\u4e86\u4e00\u6279\u6d88\u606f\uff0c\u5728sequenceNumber\u4e4b\u524d\u7684\u6240\u6709\u6d88\u606f\u90fd\u5df2\u7ecf\u786e\u8ba4\u5b8c\u6210\u4e86\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<h2 style=\"font-size: 24px;line-height: 32px;margin-top: 21px;margin-bottom: 5px;\">9.2.Springboot\u5177\u4f53\u4f7f\u7528<\/h2>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">SpringBoot\u5b98\u65b9\u5c31\u96c6\u6210\u4e86RabbitMQ\uff0c\u6240\u4ee5RabbitMQ\u4e0eSpringBoot\u7684\u96c6\u6210\u662f\u975e\u5e38\u7b80\u5355\u7684\u3002\u4e0d\u8fc7\uff0cSpringBoot\u96c6\u6210RabbitMQ\u7684\u65b9\u5f0f\u662f\u6309\u7167Spring\u7684\u4e00\u5957\u7edf\u4e00\u7684MQ\u6a21\u578b\u521b\u5efa\u7684\uff0c\u56e0\u6b64SpringBoot\u96c6\u6210\u63d2\u4ef6\u4e2d\u5bf9\u4e8e\u751f\u4ea7\u8005\u3001\u6d88\u606f\u3001\u6d88\u8d39\u8005\u7b49\u91cd\u8981\u7684\u5bf9\u8c61\u6a21\u578b\uff0c\u4e0eRabbitMQ\u539f\u751f\u7684\u5404\u4e2a\u7ec4\u4ef6\u6709\u5bf9\u5e94\u5173\u7cfb\uff0c\u4f46\u662f\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002\u8fd9\u4e00\u70b9\u9700\u8981\u5728\u540e\u7eed\u8bd5\u9a8c\u8fc7\u7a0b\u4e2d\u52a0\u6df1\u7406\u89e3\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.2.1.\u5f15\u5165\u4f9d\u8d56<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">SpringBoot\u5b98\u65b9\u96c6\u6210\u4e86RabbitMQ\uff0c\u53ea\u9700\u8981\u5feb\u901f\u5f15\u5165\u4f9d\u8d56\u5305\u5373\u53ef\u4f7f\u7528\u3002RabbitMQ\u4e0eSpringBoot\u96c6\u6210\u7684\u6838\u5fc3maven\u4f9d\u8d56\u5c31\u4e0b\u9762\u4e00\u4e2a\u3002<\/span><\/p>\n<pre data-language=\"plain\" style=\"border-width: 1px;border-style: solid;border-color: rgb(232, 232, 232);border-radius: 2px;background: rgb(249, 249, 249);padding: 16px;font-size: 13px;color: rgb(89, 89, 89);\"><code>&lt;dependency&gt;\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\t&lt;artifactId&gt;spring-boot-starter-amqp&lt;\/artifactId&gt;&lt;\/dependency&gt;<\/code><\/pre>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u8981\u7279\u522b\u6ce8\u610f\u4e0b\u7248\u672c\u3002\u6211\u4eec\u8fd9\u91cc\u91c7\u7528\u7684\u662fSpringBoot\u76842.6.7\u7248\u672c\u7684\u4f9d\u8d56\u53d1\u5e03\u5305\u3002\u4e0d\u540c\u7248\u672c\u4e0b\u7684\u914d\u7f6e\u65b9\u5f0f\u4f1a\u6709\u53d8\u5316\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u7136\u540e\u6240\u6709\u7684\u57fa\u7840\u8fd0\u884c\u73af\u5883\u90fd\u5728application.properties\u4e2d\u8fdb\u884c\u914d\u7f6e\u3002\u6240\u6709\u914d\u7f6e\u4ee5spring.rabbitmq\u5f00\u5934\u3002\u901a\u5e38\u6309\u7167\u793a\u4f8b\u8fdb\u884c\u4e00\u4e9b\u57fa\u7840\u7684\u5fc5\u8981\u914d\u7f6e\u5c31\u53ef\u4ee5\u8dd1\u4e86\u3002\u5173\u4e8e\u8be6\u7ec6\u7684\u914d\u7f6e\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u89c1RabbitProperties\uff0c\u6e90\u7801\u4e2d\u6709\u5404\u4e2a\u5b57\u6bb5\u8bf4\u660e\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5982\u679c\u9700\u8981\u66f4\u8be6\u7ec6\u7684\u914d\u7f6e\u8d44\u6599\uff0c\u90a3\u5c31\u9700\u8981\u5230\u5b98\u65b9\u7684github\u4ed3\u5e93\u4e0a\u53bb\u67e5\u4e86\u3002\u4f46\u662f\u56fd\u5185\u8bbf\u95eegithub\u7684\u8fd9\u4e2a\u901f\u5ea6\uff0c\u4f60\u662f\u77e5\u9053\u7684\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.2.2.\u914d\u7f6e\u751f\u4ea7\u8005<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u57fa\u7840\u7684\u8fd0\u884c\u73af\u5883\u53c2\u6570\u4ee5\u53ca\u751f\u4ea7\u8005\u7684\u4e00\u4e9b\u9ed8\u8ba4\u5c5e\u6027\u914d\u7f6e\u90fd\u96c6\u4e2d\u5230\u4e86application.properties\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002\u6240\u6709\u914d\u7f6e\u9879\u90fd\u4ee5spring.rabbitmq\u5f00\u5934\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5173\u4e8e\u8be6\u7ec6\u7684\u914d\u7f6e\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u89c1RabbitProperties\u7c7b\u7684\u6e90\u7801\uff0c\u6e90\u7801\u4e2d\u6709\u5404\u4e2a\u5b57\u6bb5\u7684\u7b80\u5355\u8bf4\u660e\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5982\u679c\u9700\u8981\u66f4\u8be6\u7ec6\u7684\u914d\u7f6e\u8d44\u6599\uff0c\u90a3\u5c31\u9700\u8981\u53bb\u5b98\u65b9\u7684github\u4ed3\u5e93\u4e0a\u53bb\u67e5\u4e86\u3002github\u5730\u5740\uff1a <\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">https:\/\/github.com\/spring-projects\/spring-amqp<\/span><span style=\"color: rgb(119, 119, 119);font-size: 14px;\"> \u3002\u4f46\u662f\u56fd\u5185\u8bbf\u95eegithub\u7684\u901f\u5ea6\uff0c\u4f60\u77e5\u9053\u7684\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.2.3.\u58f0\u660e\u961f\u5217<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6240\u6709\u7684exchange, queue, binding\u7684\u914d\u7f6e\uff0c\u90fd\u9700\u8981\u4ee5\u5bf9\u8c61\u7684\u65b9\u5f0f\u58f0\u660e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e9b\u4e1a\u52a1\u5bf9\u8c61\u4e00\u7ecf\u58f0\u660e\uff0c\u5e94\u7528\u5c31\u4f1a\u81ea\u52a8\u5230RabbitMQ\u4e0a\u5e38\u89c1\u5bf9\u5e94\u7684\u4e1a\u52a1\u5bf9\u8c61\u3002\u4f46\u662f\u4e5f\u662f\u53ef\u4ee5\u914d\u7f6e\u6210\u7ed1\u5b9a\u5df2\u6709\u4e1a\u52a1\u5bf9\u8c61\u7684\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\">9.2.4.<span style=\"color: rgb(51, 51, 51);\">\u4f7f\u7528RabbitmqTemplate\u5bf9\u8c61\u53d1\u9001\u6d88\u606f<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u751f\u4ea7\u8005\u7684\u6240\u6709\u5c5e\u6027\u90fd\u5df2\u7ecf\u5728application.properties\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u914d\u7f6e\u3002\u9879\u76ee\u542f\u52a8\u65f6\uff0c\u5c31\u4f1a\u5728Spring\u5bb9\u5668\u4e2d\u521d\u59cb\u5316\u4e00\u4e2aRabbitmqTemplate\u5bf9\u8c61\uff0c\u7136\u540e\u6240\u6709\u7684\u53d1\u9001\u6d88\u606f\u64cd\u4f5c\u90fd\u901a\u8fc7\u8fd9\u4e2a\u5bf9\u8c61\u6765\u8fdb\u884c\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.2.5.\u4f7f\u7528@RabbitListener\u6ce8\u89e3\u58f0\u660e\u6d88\u8d39\u8005<\/span><\/h3>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6d88\u8d39\u8005\u90fd\u662f\u901a\u8fc7@RabbitListener\u6ce8\u89e3\u6765\u58f0\u660e\u3002\u6ce8\u89e3\u4e2d\u5305\u542b\u4e86\u58f0\u660e\u6d88\u8d39\u8005\u961f\u5217\u65f6\u6240\u9700\u8981\u7684\u91cd\u70b9\u53c2\u6570\u3002\u5bf9\u7167\u539f\u751fAPI\uff0c\u8fd9\u4e9b\u53c2\u6570\u5c31\u4e0d\u96be\u7406\u89e3\u4e86\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f46\u662f\u5f53\u8981\u6d88\u8d39Stream\u961f\u5217\u65f6\uff0c\u8fd8\u662f\u8981\u91cd\u70b9\u6ce8\u610f\u4ed6\u7684\u4e09\u4e2a\u5fc5\u8981\u7684\u6b65\u9aa4\uff1a<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 23px;\">\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">channel\u5fc5\u987b\u8bbe\u7f6ebasicQos\u5c5e\u6027\u3002 channel\u5bf9\u8c61\u53ef\u4ee5\u5728@RabbitListener\u58f0\u660e\u7684\u6d88\u8d39\u8005\u65b9\u6cd5\u4e2d\u76f4\u63a5\u5f15\u7528\uff0cSpring\u6846\u67b6\u4f1a\u8fdb\u884c\u6ce8\u5165\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6b63\u786e\u58f0\u660eStream\u961f\u5217\u3002 \u901a\u8fc7\u5f80Spring\u5bb9\u5668\u4e2d\u6ce8\u5165Queue\u5bf9\u8c61\u7684\u65b9\u5f0f\u58f0\u660e\u961f\u5217\u3002\u5728Queue\u5bf9\u8c61\u4e2d\u4f20\u5165\u58f0\u660eStream\u961f\u5217\u6240\u9700\u8981\u7684\u53c2\u6570\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u6d88\u8d39\u65f6\u9700\u8981\u6307\u5b9aoffset\u3002 \u53ef\u4ee5\u901a\u8fc7\u6ce8\u5165Channel\u5bf9\u8c61\uff0c\u4f7f\u7528\u539f\u751fAPI\u4f20\u5165offset\u5c5e\u6027\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u4f7f\u7528SpringBoot\u6846\u67b6\u96c6\u6210RabbitMQ\u540e\uff0c\u5f00\u53d1\u8fc7\u7a0b\u53ef\u4ee5\u5f97\u5230\u5f88\u5927\u7684\u7b80\u5316\uff0c\u6240\u4ee5\u4f7f\u7528\u8fc7\u7a0b\u5e76\u4e0d\u96be\uff0c\u5bf9\u7167\u4e00\u4e0b\u793a\u4f8b\u5c31\u80fd\u5f88\u5feb\u4e0a\u624b\u3002\u4f46\u662f\uff0c\u9700\u8981\u7406\u89e3\u4e00\u4e0b\u7684\u662f\uff0cSpringBoot\u96c6\u6210\u540e\u7684RabbitMQ\u4e2d\u7684\u5f88\u591a\u6982\u5ff5\uff0c\u867d\u7136\u90fd\u80fd\u8ddf\u539f\u751fAPI\u5bf9\u5e94\u4e0a\uff0c\u4f46\u662f\u8fd9\u4e9b\u6a21\u578b\u4e2d\u95f4\u90fd\u662f\u505a\u4e86\u8f6c\u6362\u7684\uff0c\u6bd4\u5982Message\uff0c\u5c31\u4e0d\u662f\u539f\u751fRabbitMQ\u4e2d\u7684\u6d88\u606f\u4e86\u3002\u4f7f\u7528SpringBoot\u6846\u67b6\uff0c\u5c24\u5176\u9700\u8981\u52a0\u6df1\u5bf9RabbitMQ\u539f\u751fAPI\u7684\u7406\u89e3\uff0c\u8fd9\u6837\u624d\u80fd\u4ee5\u4e0d\u53d8\u5e94\u4e07\u53d8\uff0c\u6df1\u5165\u7406\u89e3\u5404\u79cd\u770b\u8d77\u6765\u7b80\u5355\uff0c\u4f46\u662f\u5176\u5b9e\u5751\u5f88\u591a\u7684\u5404\u79cd\u5bf9\u8c61\u58f0\u660e\u65b9\u5f0f\u3002<\/span><\/p>\n<h3 style=\"line-height: 28px;margin-top: 16px;margin-bottom: 5px;\"><span style=\"color: rgb(51, 51, 51);\">9.2.6\uff1a\u5173\u4e8eStream\u961f\u5217<\/span><\/h3>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5728\u76ee\u524d\u7248\u672c\u4e0b\uff0c\u4f7f\u7528RabbitMQ\u7684SpringBoot\u6846\u67b6\u96c6\u6210\uff0c\u53ef\u4ee5\u6b63\u5e38\u58f0\u660eStream\u961f\u5217\uff0c\u5f80Stream\u961f\u5217\u53d1\u9001\u6d88\u606f\uff0c\u4f46\u662f\u65e0\u6cd5\u76f4\u63a5\u6d88\u8d39Stream\u961f\u5217\u4e86\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5173\u4e8e\u8fd9\u4e2a\u95ee\u9898\uff0c\u8fd8\u662f\u9700\u8981\u4eceStream\u961f\u5217\u7684\u4e09\u4e2a\u91cd\u70b9\u64cd\u4f5c\u5165\u624b\u3002SpringBoot\u6846\u67b6\u96c6\u6210RabbitMQ\u540e\uff0c\u4e3a\u4e86\u7b80\u5316\u7f16\u7a0b\u6a21\u578b\uff0c\u5c31\u628achannel\uff0cconnection\u7b49\u8fd9\u4e9b\u5173\u952e\u5bf9\u8c61\u7ed9\u9690\u85cf\u4e86\uff0c\u76ee\u524d\u6846\u67b6\u4e0b\uff0c\u65e0\u6cd5\u76f4\u63a5\u63a5\u5165\u8fd9\u4e9b\u5bf9\u8c61\u7684\u6ce8\u5165\u8fc7\u7a0b\uff0c\u6240\u4ee5\u65e0\u6cd5\u76f4\u63a5\u4f7f\u7528\u3002<\/span><\/p>\n<p style=\"min-height: 24px;text-indent: 2em;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u5982\u679c\u975e\u8981\u4f7f\u7528Stream\u961f\u5217\uff0c\u90a3\u4e48\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f\u4f7f\u7528\u539f\u751fAPI\u7684\u65b9\u5f0f\uff0c\u5728SpringBoot\u6846\u67b6\u4e0b\u81ea\u884c\u5c01\u88c5\u3002\u53e6\u4e00\u79cd\u662f\u4f7f\u7528RabbitMQ\u7684Stream \u63d2\u4ef6\u3002\u5728\u670d\u52a1\u7aef\u901a\u8fc7Strem\u63d2\u4ef6\u6253\u5f00TCP\u8fde\u63a5\u63a5\u53e3\uff0c\u5e76\u914d\u5408\u5355\u72ec\u63d0\u4f9b\u7684Stream\u5ba2\u6237\u7aef\u4f7f\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u5bf9\u5e94\u7528\u7aef\u7684\u5f71\u54cd\u592a\u91cd\u4e86\uff0c\u5e76\u4e14\u5e76\u6ca1\u6709\u63d0\u4f9b\u4e0eSpringBoot\u6846\u67b6\u7684\u96c6\u6210\uff0c\u8fd8\u9700\u8981\u81ea\u884c\u5b8c\u5584\uff0c\u56e0\u6b64\u9009\u62e9\u4f7f\u7528\u7684\u4f01\u4e1a\u8fd8\u6bd4\u8f83\u5c11\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u8fd9\u91cc\u5c31\u4e0d\u8be6\u7ec6\u4ecb\u7ecd\u4f7f\u7528\u65b9\u5f0f\u4e86\u3002\u5173\u4e8eStream\u63d2\u4ef6\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u65b9\u5f0f\u53c2\u89c1\u5b98\u65b9\u6587\u6863\uff1a<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">https:\/\/www.rabbitmq.com\/stream.html\u3002\u914d\u5408Stream\u63d2\u4ef6\u4f7f\u7528\u7684\u5ba2\u6237\u7aef\u6709Java\u548cGO\u4e24\u4e2a\u7248\u672c\u3002\u5176\u4e2dJava\u7248\u672c\u5ba2\u6237\u7aef\u53c2\u89c1git\u4ed3\u5e93\uff1ahttps:\/\/github.com\/rabbitmq\/rabbitmq-stream-java-client<\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\"> <\/span><span style=\"color: rgb(51, 51, 51);font-size: 14px;\">\u3002<\/span><\/p>\n<p style=\"min-height: 24px;\"><span style=\"color: rgb(119, 119, 119);font-size: 14px;\">\u5176\u5b9e\u5173\u4e8eStream\u961f\u5217\uff0c\u73b0\u5728\u4e5f\u4e0d\u9700\u8981\u7740\u6025\u4e0a\u624b\uff0c\u53ea\u662f\u628a\u4ed6\u5f53\u4f5c\u4e00\u79cd\u7279\u6b8a\u7684\u961f\u5217\u7c7b\u578b\uff0c\u4e0a\u624b\u4e86\u89e3\u5373\u53ef\u3002\u56e0\u4e3a\u4e00\u65b9\u9762\u592a\u65b0\u7684\u6280\u672f\uff0c\u5f80\u5f80\u8fd8\u9700\u8981\u5c0f\u767d\u9f20\u591a\u591a\u9a8c\u8bc1\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u73b0\u5728RabbitMQ\u591a\u79cd\u961f\u5217\u5e76\u5b58\u7684\u72b6\u6001\uff0c\u5728\u4e0d\u4e45\u80af\u5b9a\u4f1a\u5f97\u5230\u7b80\u5316\uff0c\u5230\u65f6\u5019\uff0c\u5e94\u7528\u5c42\u7684\u4f7f\u7528\u65b9\u5f0f\u4e5f\u80af\u5b9a\u4f1a\u8ddf\u7740\u53d8\u5316\u3002<\/span><\/p>\n<p>\u5199\u5728\u6700\u540e<\/p>\n<p>  \u5982\u679c\u60a8\u89c9\u5f97\u8fd9\u4e9b\u6587\u7ae0\u5bf9\u60a8\u6709\u6240\u542f\u53d1\u548c\u5e2e\u52a9\uff0c\u4f55\u4e0d\u5c06\u5b83\u4eec\u4e0e\u60a8\u7684\u597d\u53cb\u5206\u4eab\u5462\uff1f\u8fd9\u6837\uff0c\u4ed6\u4eec\u4e5f\u80fd\u591f\u4eab\u53d7\u5176\u4e2d\u7684\u7cbe\u5f69\u5185\u5bb9\uff0c\u5e76\u4ece\u4e2d\u83b7\u5f97\u542f\u53d1\u3002\u8c22\u8c22\u60a8\u7684\u652f\u6301\u4e0e\u5206\u4eab\uff01~<\/p>\n<p>  \u540c\u65f6\u4e5f\u5e0c\u671b\u60a8\u7528\u53d1\u8d22\u7684\u624b\u5e2e\u5fd9\u70b9\u4e2a\u5173\u6ce8\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e0b\u65b9\u83dc\u5355\u70b9\u51fb\u798f\u5229\u9886\u53d6\u4e0a\u5343\u5957\u7b80\u5386\u6a21\u677f\u3001\u51e0\u5343\u9053\u7684\u9762\u8bd5\u9898pdf\u4ee5\u53ca\u51e0\u767eG\u6db5\u76d6\u4e86Java\u5f00\u53d1\uff0c\u524d\u7aef\u5f00\u53d1\uff0c\u5c0f\u7a0b\u5e8f\u5f00\u53d1\uff0c\u6570\u636e\u5e93\uff0c\u6d4b\u8bd5\u7b49\u7b49\u7684\u76f8\u5173\u5b66\u4e60\u4e66\u7c4d\u4e0e\u8d44\u6599\u3002<\/p>\n<p><span style=\"background-color: rgb(25, 25, 25);color: rgba(255, 255, 255, 0.6);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;font-size: var(--articleFontsize);\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000892\" data-ratio=\"2.1638888888888888\" data-s=\"300,640\"  data-type=\"jpeg\" data-w=\"1080\" style=\"letter-spacing: 0.578px;text-align: center;text-wrap: wrap;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224349410.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000892\" data-ratio=\"2.1638888888888888\" data-s=\"300,640\"  data-type=\"jpeg\" data-w=\"1080\" style=\"letter-spacing: 0.578px;text-align: center;text-wrap: wrap;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224349410.jpeg\"  \/><\/noscript><\/span><\/p>\n<p>\u53e6\u5916\u4e5f\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u4ea4\u6d41\u7fa4\u6309\u94ae\u6dfb\u52a0\u6211\u597d\u53cb\uff0c\u7136\u540e\u62c9\u60a8\u5230\u81ea\u5df1\u7684\u521b\u5efa\u7684Java\u77e5\u8bc6\u5206\u4eab\u7fa4\u3002\u4e00\u8d77\u53bb\u8ba8\u8bba\u3001\u5b66\u4e60\u3001\u6210\u957f\u3001\u8fdb\u6b65\uff0c\u8c22\u8c22~<\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u733f\u4eba\u5218\u5148\u751f              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>1.\u4ec0\u4e48\u662fMQ?\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528MQ MQ\uff1aMessageQueue\uff0c\u6d88\u606f\u961f\u5217\u3002 \u961f\u5217\uff0c\u662f\u4e00\u79cdFIFO \u5148\u8fdb\u5148\u51fa\u7684\u6570\u636e\u7ed3\u6784\u3002\u6d88\u606f\u7531\u751f\u4ea7 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":6190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[31],"tags":[],"class_list":["post-6253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rabbitmq"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969-1024x436.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969-1024x436.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224032969.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224047256.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224053891.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224053891.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224057111.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224057111.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224101838.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224101838.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224105790.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224105790.png","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109493.png","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109493.png","id":"image11"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224115418.png","id":"image12"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224115418.png","id":"image13"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224118630.png","id":"image14"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224118630.png","id":"image15"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224121866.png","id":"image16"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224121866.png","id":"image17"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224123780.png","id":"image18"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224123780.png","id":"image19"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224128981.png","id":"image20"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224128981.png","id":"image21"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224133133.png","id":"image22"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224133133.png","id":"image23"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224136528.png","id":"image24"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224136528.png","id":"image25"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224139592.png","id":"image26"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224139592.png","id":"image27"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224141934.png","id":"image28"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224141934.png","id":"image29"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224144572.png","id":"image30"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224144572.png","id":"image31"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224147654.png","id":"image32"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224147654.png","id":"image33"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224152942.png","id":"image34"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224152942.png","id":"image35"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224157291.png","id":"image36"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224157291.png","id":"image37"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224202366.png","id":"image38"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224202366.png","id":"image39"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224207511.png","id":"image40"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224207511.png","id":"image41"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224210173.png","id":"image42"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224210173.png","id":"image43"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224214401.png","id":"image44"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224214401.png","id":"image45"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224221409.png","id":"image46"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224221409.png","id":"image47"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224227490.png","id":"image48"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224227490.png","id":"image49"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224235980.png","id":"image50"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224235980.png","id":"image51"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224240828.png","id":"image52"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224240828.png","id":"image53"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224243484.png","id":"image54"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224243484.png","id":"image55"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224248288.png","id":"image56"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224248288.png","id":"image57"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224251255.png","id":"image58"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224251255.png","id":"image59"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224256501.png","id":"image60"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224256501.png","id":"image61"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224300765.png","id":"image62"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224300765.png","id":"image63"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224304377.png","id":"image64"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224304377.png","id":"image65"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224308183.png","id":"image66"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224308183.png","id":"image67"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224311540.png","id":"image68"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224311540.png","id":"image69"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224316171.png","id":"image70"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224316171.png","id":"image71"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224321182.png","id":"image72"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224321182.png","id":"image73"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224325937.png","id":"image74"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224325937.png","id":"image75"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224329247.png","id":"image76"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224329247.png","id":"image77"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224333536.png","id":"image78"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224333536.png","id":"image79"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224336336.png","id":"image80"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224336336.png","id":"image81"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224339899.png","id":"image82"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224339899.png","id":"image83"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224342524.png","id":"image84"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224342524.png","id":"image85"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224345509.png","id":"image86"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224345509.png","id":"image87"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224349410.jpeg","id":"image88"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224349410.jpeg","id":"image89"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"RabbitMQ","post_date":"2024-08-01","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":411,"next_post_id":5195,"next_post_title":"RocketMQ\u4e00\u6761\u6d88\u606f\u77ed\u6682\u800c\u53c8\u7cbe\u5f69\u7684\u4e00\u751f\uff01","previous_post_id":6201,"previous_post_title":"springboot + rabbitmq\u5b9e\u73b0\u90ae\u4ef6\u53d1\u9001\uff0c\u4fdd\u8bc1\u6d88\u606f100%\u6295\u9012\u6210\u529f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6253","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=6253"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6253\/revisions"}],"predecessor-version":[{"id":6306,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6253\/revisions\/6306"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/6190"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=6253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=6253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=6253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}