{"id":7020,"date":"2026-02-28T21:21:33","date_gmt":"2026-02-28T13:21:33","guid":{"rendered":"https:\/\/t.n-years.com\/?p=7020"},"modified":"2026-02-28T21:21:33","modified_gmt":"2026-02-28T13:21:33","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e9%87%91%e8%9e%8d%e4%ba%a4%e6%98%93%e9%83%bd%e9%80%89%e6%8b%a9-rabbitmq","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=7020","title":{"rendered":"\u4e3a\u4ec0\u4e48\u91d1\u878d\u4ea4\u6613\u90fd\u9009\u62e9 RabbitMQ"},"content":{"rendered":"<p>\u91d1\u878d\u4ea4\u6613\u9009\u62e9 RabbitMQ\uff0c\u6838\u5fc3\u662f\u5b83\u5728<strong>\u53ef\u9760\u6027\u3001\u7a33\u5b9a\u6027\u3001\u7075\u6d3b\u8def\u7531\u3001\u4f4e\u5ef6\u8fdf\u3001\u6210\u719f\u751f\u6001<\/strong>\u4e0a\uff0c\u5b8c\u7f8e\u5339\u914d\u91d1\u878d\u201c<strong>\u96f6\u4e22\u6d88\u606f\u3001\u5f3a\u4e00\u81f4\u3001\u9ad8\u53ef\u7528\u3001\u590d\u6742\u5206\u53d1\u3001\u5b9e\u65f6\u5904\u7406<\/strong>\u201d\u7684\u6838\u5fc3\u8bc9\u6c42\u3002<\/p>\n<h3>\u4e00\u3001\u91d1\u878d\u7ea7\u53ef\u9760\u6027\uff08\u6700\u6838\u5fc3\u539f\u56e0\uff09<\/h3>\n<p>\u91d1\u878d\u4ea4\u6613\u5bf9\u6d88\u606f\u4e22\u5931\u3001\u91cd\u590d\u3001\u4e71\u5e8f\u96f6\u5bb9\u5fcd\uff0cRabbitMQ \u63d0\u4f9b\u5168\u94fe\u8def\u4fdd\u969c\uff1a<\/p>\n<ol>\n<li><strong>\u4e09\u91cd\u6301\u4e45\u5316<\/strong>\uff1a\u4ea4\u6362\u673a\u3001\u961f\u5217\u3001\u6d88\u606f\uff08delivery_mode=2\uff09\u540c\u65f6\u6301\u4e45\u5316\u5230\u78c1\u76d8\uff0cBroker \u5b95\u673a\u91cd\u542f\u540e\u6d88\u606f\u4e0d\u4e22\u5931\u3002<\/li>\n<li><strong>\u751f\u4ea7\/\u6d88\u8d39\u786e\u8ba4<\/strong>\uff1a\n<ul>\n<li>\u751f\u4ea7\u8005\uff1aPublisher Confirm \u5f02\u6b65\u786e\u8ba4\uff0c\u786e\u4fdd\u6d88\u606f\u6210\u529f\u5230\u8fbe Broker\u3002<\/li>\n<li>\u6d88\u8d39\u8005\uff1a\u624b\u52a8 ACK\uff0c\u4e1a\u52a1\u5904\u7406\u5b8c\u6210\u624d\u786e\u8ba4\uff0c\u907f\u514d\u6d88\u606f\u4e22\u5931\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4e8b\u52a1\u673a\u5236<\/strong>\uff1a\u652f\u6301 AMQP \u672c\u5730\u4e8b\u52a1\uff0c\u9002\u5408\u5f3a\u4e00\u81f4\u7684\u5173\u952e\u4ea4\u6613\u73af\u8282\u3002<\/li>\n<li><strong>\u6b7b\u4fe1\u961f\u5217\uff08DLX\uff09<\/strong>\uff1a\u5904\u7406\u5931\u8d25\u3001\u8fc7\u671f\u3001\u961f\u5217\u6ee1\u7684\u6d88\u606f\uff0c\u9632\u6b62\u4ea4\u6613\u6570\u636e\u4e22\u5931\u3002<\/li>\n<li><strong>\u955c\u50cf\u961f\u5217<\/strong>\uff1a\u961f\u5217\u591a\u8282\u70b9\u5907\u4efd\uff0c\u8282\u70b9\u6545\u969c\u81ea\u52a8\u5207\u6362\uff0c\u65e0\u5355\u70b9\u98ce\u9669\u3002<\/li>\n<\/ol>\n<h3>\u4e8c\u3001Erlang \u5e95\u5c42\u7684\u9ad8\u53ef\u7528\u4e0e\u7a33\u5b9a\u6027<\/h3>\n<ul>\n<li>\u57fa\u4e8e Erlang\uff08\u7535\u4fe1\u7ea7\u8bed\u8a00\uff09\u5f00\u53d1\uff0c\u5929\u751f\u652f\u6301<strong>\u70ed\u5347\u7ea7\u3001\u70ed\u90e8\u7f72\u3001\u5206\u5e03\u5f0f\u5bb9\u9519<\/strong>\uff0c\u9002\u5408 7\u00d724 \u5c0f\u65f6\u8fd0\u884c\u7684\u91d1\u878d\u7cfb\u7edf\u3002<\/li>\n<li>\u8f7b\u91cf\u7ea7\u8fdb\u7a0b\u6a21\u578b\uff0c\u5355\u8282\u70b9\u53ef\u652f\u6491<strong>\u767e\u4e07\u7ea7\u8fde\u63a5<\/strong>\uff0c\u5e76\u53d1\u4e0e\u7a33\u5b9a\u6027\u6781\u5f3a\u3002<\/li>\n<\/ul>\n<h3>\u4e09\u3001\u7075\u6d3b\u8def\u7531\u9002\u914d\u590d\u6742\u4ea4\u6613\u6d41\u7a0b<\/h3>\n<p>\u91d1\u878d\u7cfb\u7edf\uff08\u652f\u4ed8\u3001\u6e05\u7b97\u3001\u98ce\u63a7\u3001\u5bf9\u8d26\uff09\u9700\u8981\u590d\u6742\u5206\u53d1\uff0cRabbitMQ \u63d0\u4f9b 4 \u79cd\u4ea4\u6362\u673a\uff1a<\/p>\n<ul>\n<li><strong>Direct<\/strong>\uff1a\u7cbe\u51c6\u8def\u7531\uff08\u5982\u8ba2\u5355 ID \u5339\u914d\uff09\u3002<\/li>\n<li><strong>Topic<\/strong>\uff1a\u6a21\u7cca\u5339\u914d\uff08\u5982\u6309\u4ea4\u6613\u7c7b\u578b\u3001\u6e20\u9053\u5206\u53d1\uff09\u3002<\/li>\n<li><strong>Fanout<\/strong>\uff1a\u5e7f\u64ad\uff08\u5982\u884c\u60c5\u3001\u98ce\u63a7\u901a\u77e5\uff09\u3002<\/li>\n<li><strong>Headers<\/strong>\uff1a\u57fa\u4e8e\u6d88\u606f\u5934\u8def\u7531\uff08\u9002\u914d\u590d\u6742\u4e1a\u52a1\u89c4\u5219\uff09\u3002<br \/>\n\u53ef\u5b9e\u73b0\u4e00\u7b14\u4ea4\u6613\u6d88\u606f\u540c\u65f6\u5206\u53d1\u5230<strong>\u8d26\u52a1\u3001\u98ce\u63a7\u3001\u65e5\u5fd7\u3001\u5bf9\u8d26<\/strong>\u7b49\u591a\u4e2a\u7cfb\u7edf\uff0c\u89e3\u8026\u4e14\u7075\u6d3b\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u4f4e\u5ef6\u8fdf\u4e0e\u6d41\u91cf\u524a\u5cf0<\/h3>\n<ul>\n<li>\u5fae\u79d2\u7ea7\u5ef6\u8fdf\uff0c\u6ee1\u8db3\u4ea4\u6613\u5b9e\u65f6\u6027\u8981\u6c42\u3002<\/li>\n<li>\u961f\u5217\u5929\u7136\u7f13\u51b2\uff0c\u5e94\u5bf9\u5f00\u76d8\u3001\u5927\u4fc3\u7b49\u7a81\u53d1\u6d41\u91cf\uff0c\u907f\u514d\u6570\u636e\u5e93\/\u6838\u5fc3\u670d\u52a1\u96ea\u5d29\u3002<\/li>\n<\/ul>\n<h3>\u4e94\u3001\u6210\u719f\u751f\u6001\u4e0e\u8fd0\u7ef4\u53cb\u597d<\/h3>\n<ul>\n<li>\u6807\u51c6 AMQP \u534f\u8bae\uff0c\u591a\u8bed\u8a00\u5ba2\u6237\u7aef\uff08Java\/Go\/Python\uff09\uff0c\u6613\u96c6\u6210 legacy \u7cfb\u7edf\u3002<\/li>\n<li>\u5b8c\u5584 Web \u7ba1\u7406\u754c\u9762\u3001\u76d1\u63a7\u63d2\u4ef6\u3001\u793e\u533a\u4e0e\u6587\u6863\uff0c\u6545\u969c\u6392\u67e5\u4e0e\u8fd0\u7ef4\u6210\u672c\u4f4e\u3002<\/li>\n<li>\u63d2\u4ef6\u4e30\u5bcc\uff08\u5ef6\u8fdf\u961f\u5217\u3001\u4f18\u5148\u7ea7\u961f\u5217\u3001\u6d41\u91cf\u63a7\u5236\uff09\uff0c\u6ee1\u8db3\u91d1\u878d\u7279\u6b8a\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>\u516d\u3001\u4e0e\u5176\u4ed6 MQ \u7684\u9009\u578b\u5bf9\u6bd4\uff08\u91d1\u878d\u89c6\u89d2\uff09<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u7279\u6027<\/th>\n<th>RabbitMQ<\/th>\n<th>Kafka<\/th>\n<th>RocketMQ<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u53ef\u9760\u6027<\/strong><\/td>\n<td>\u6781\u5f3a\uff08\u91d1\u878d\u7ea7\uff09<\/td>\n<td>\u9ad8\uff08\u4fa7\u91cd\u541e\u5410\uff09<\/td>\n<td>\u6781\u5f3a\uff08\u542b\u5206\u5e03\u5f0f\u4e8b\u52a1\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8def\u7531\u80fd\u529b<\/strong><\/td>\n<td>\u6781\u5f3a\uff084 \u79cd\u4ea4\u6362\u673a\uff09<\/td>\n<td>\u5f31\uff08\u5206\u533a Topic\uff09<\/td>\n<td>\u4e2d<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5ef6\u8fdf<\/strong><\/td>\n<td>\u5fae\u79d2\u7ea7<\/td>\n<td>\u6beb\u79d2\u7ea7<\/td>\n<td>\u6beb\u79d2\u7ea7<\/td>\n<\/tr>\n<tr>\n<td><strong>\u4e8b\u52a1<\/strong><\/td>\n<td>\u672c\u5730\u4e8b\u52a1<\/td>\n<td>\u5f31<\/td>\n<td>\u5206\u5e03\u5f0f\u4e8b\u52a1\uff08\u534a\u6d88\u606f\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u9002\u7528\u573a\u666f<\/strong><\/td>\n<td>\u4ea4\u6613\u3001\u652f\u4ed8\u3001\u6e05\u7b97\u3001\u590d\u6742\u8def\u7531<\/td>\n<td>\u65e5\u5fd7\u3001\u5927\u6570\u636e\u3001\u9ad8\u541e\u5410<\/td>\n<td>\u7535\u5546\u5927\u4fc3\u3001\u5206\u5e03\u5f0f\u4e8b\u52a1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e03\u3001\u9002\u7528\u4e0e\u4e0d\u9002\u7528\u573a\u666f<\/h3>\n<ul>\n<li><strong>\u9002\u5408<\/strong>\uff1a\u652f\u4ed8\u3001\u8ba2\u5355\u3001\u6e05\u7b97\u3001\u98ce\u63a7\u3001\u5bf9\u8d26\u3001\u5b9e\u65f6\u901a\u77e5\u7b49<strong>\u5f3a\u4e00\u81f4\u3001\u590d\u6742\u8def\u7531\u3001\u4f4e\u5ef6\u8fdf<\/strong>\u573a\u666f\u3002<\/li>\n<li><strong>\u4e0d\u9002\u5408<\/strong>\uff1a\u8d85\u5927\u89c4\u6a21\u65e5\u5fd7\u3001\u5927\u6570\u636e\u6d41\u3001\u6781\u81f4\u9ad8\u541e\u5410\uff08\u767e\u4e07 TPS\uff09\u573a\u666f\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u91d1\u878d\u9009 RabbitMQ\uff0c\u662f\u7528<strong>\u6781\u81f4\u53ef\u9760+\u7075\u6d3b\u8def\u7531+\u7a33\u5b9a Erlang \u5185\u6838<\/strong>\uff0c\u6362\u4ea4\u6613\u94fe\u8def\u7684<strong>\u5b89\u5168\u3001\u4e00\u81f4\u3001\u53ef\u63a7<\/strong>\u3002<\/p>\n<p>\u9700\u8981\u6211\u7ed9\u4f60\u4e00\u4efd\u91d1\u878d\u4ea4\u6613\u573a\u666f\u4e0b RabbitMQ \u7684<strong>\u6838\u5fc3\u914d\u7f6e\u6e05\u5355<\/strong>\uff08\u6301\u4e45\u5316\u3001\u786e\u8ba4\u3001\u6b7b\u4fe1\u3001\u955c\u50cf\u961f\u5217\uff09\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u5417\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91d1\u878d\u4ea4\u6613\u9009\u62e9 RabbitMQ\uff0c\u6838\u5fc3\u662f\u5b83\u5728\u53ef\u9760\u6027\u3001\u7a33\u5b9a\u6027\u3001\u7075\u6d3b\u8def\u7531\u3001\u4f4e\u5ef6\u8fdf\u3001\u6210\u719f\u751f\u6001\u4e0a\uff0c\u5b8c\u7f8e\u5339\u914d\u91d1\u878d\u201c\u96f6\u4e22\u6d88\u606f&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=7020\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[123],"tags":[],"class_list":["post-7020","post","type-post","status-publish","format-standard","hentry","category-123"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7020"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7020\/revisions"}],"predecessor-version":[{"id":7021,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7020\/revisions\/7021"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}