{"id":6522,"date":"2024-08-29T20:36:10","date_gmt":"2024-08-29T12:36:10","guid":{"rendered":"https:\/\/t.n-years.com\/?p=6522"},"modified":"2024-08-29T20:42:01","modified_gmt":"2024-08-29T12:42:01","slug":"rocketmq-%e4%b8%bb%e8%a6%81%e7%9f%a5%e8%af%86%e7%82%b9","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=6522","title":{"rendered":"RocketMQ \u4e3b\u8981\u77e5\u8bc6\u70b9"},"content":{"rendered":"<blockquote>\n<p>\u975e\u539f\u521b\u3001ChatGPT \u95ee\u7b54\u751f\u6210<\/p>\n<\/blockquote>\n<p>RocketMQ \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u6d88\u606f\u961f\u5217\u7cfb\u7edf\uff0c\u4e3b\u8981\u7528\u4e8e\u9ad8\u541e\u5410\u91cf\u3001\u9ad8\u53ef\u9760\u6027\u7684\u6d88\u606f\u4f20\u9012\u3002\u4ee5\u4e0b\u662f RocketMQ \u7684\u4e3b\u8981\u77e5\u8bc6\u70b9\u548c\u4e00\u4e9b\u5e38\u89c1\u7684\u9762\u8bd5\u95ee\u9898\u53ca\u5176\u89e3\u7b54\uff1a<\/p>\n<h3>\u4e3b\u8981\u77e5\u8bc6\u70b9<\/h3>\n<ol>\n<li>\n<p><strong>\u6d88\u606f\u6a21\u578b<\/strong>:<\/p>\n<ul>\n<li><strong>\u751f\u4ea7\u8005 (Producer)<\/strong>: \u53d1\u9001\u6d88\u606f\u5230\u6d88\u606f\u961f\u5217\u7684\u5ba2\u6237\u7aef\u3002<\/li>\n<li><strong>\u6d88\u8d39\u8005 (Consumer)<\/strong>: \u4ece\u6d88\u606f\u961f\u5217\u4e2d\u63a5\u6536\u548c\u5904\u7406\u6d88\u606f\u7684\u5ba2\u6237\u7aef\u3002<\/li>\n<li><strong>\u6d88\u606f\u961f\u5217 (Queue)<\/strong>: \u6d88\u606f\u5b58\u50a8\u7684\u5730\u65b9\uff0c\u6d88\u606f\u5728\u961f\u5217\u4e2d\u6392\u961f\u7b49\u5f85\u88ab\u6d88\u8d39\u3002<\/li>\n<li><strong>\u4e3b\u9898 (Topic)<\/strong>: \u6d88\u606f\u7684\u5206\u7c7b\uff0c\u751f\u4ea7\u8005\u5c06\u6d88\u606f\u53d1\u9001\u5230\u7279\u5b9a\u7684\u4e3b\u9898\uff0c\u6d88\u8d39\u8005\u53ef\u4ee5\u8ba2\u9605\u4e3b\u9898\u3002<\/li>\n<li><strong>\u6d88\u606f (Message)<\/strong>: \u7531\u751f\u4ea7\u8005\u53d1\u9001\u7684\u5355\u4e2a\u6570\u636e\u5355\u5143\uff0c\u5305\u62ec\u6d88\u606f\u4f53\u548c\u6d88\u606f\u5934\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6d88\u606f\u4f20\u9012\u6a21\u5f0f<\/strong>:<\/p>\n<ul>\n<li><strong>\u70b9\u5bf9\u70b9 (P2P)<\/strong>: \u751f\u4ea7\u8005\u5c06\u6d88\u606f\u53d1\u9001\u5230\u4e00\u4e2a\u961f\u5217\uff0c\u6d88\u8d39\u8005\u4ece\u8be5\u961f\u5217\u4e2d\u63a5\u6536\u6d88\u606f\u3002<\/li>\n<li><strong>\u53d1\u5e03\/\u8ba2\u9605 (Pub\/Sub)<\/strong>: \u751f\u4ea7\u8005\u5c06\u6d88\u606f\u53d1\u5e03\u5230\u4e00\u4e2a\u4e3b\u9898\uff0c\u591a\u4e2a\u6d88\u8d39\u8005\u53ef\u4ee5\u8ba2\u9605\u8be5\u4e3b\u9898\u5e76\u63a5\u6536\u6d88\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6d88\u606f\u53ef\u9760\u6027<\/strong>:<\/p>\n<ul>\n<li><strong>\u6d88\u606f\u6301\u4e45\u5316<\/strong>: \u6d88\u606f\u53ef\u4ee5\u6301\u4e45\u5316\u5230\u78c1\u76d8\uff0c\u4ee5\u4fdd\u8bc1\u6d88\u606f\u4e0d\u4f1a\u4e22\u5931\u3002<\/li>\n<li><strong>\u6d88\u606f\u786e\u8ba4<\/strong>: \u6d88\u8d39\u8005\u5904\u7406\u5b8c\u6d88\u606f\u540e\uff0c\u9700\u8981\u53d1\u9001\u786e\u8ba4\uff0cRocketMQ \u786e\u4fdd\u6d88\u606f\u88ab\u6210\u529f\u6d88\u8d39\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6d88\u606f\u987a\u5e8f<\/strong>:<\/p>\n<ul>\n<li><strong>\u987a\u5e8f\u6d88\u606f<\/strong>: RocketMQ \u652f\u6301\u987a\u5e8f\u6d88\u606f\u7684\u5904\u7406\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u6d88\u606f\u6309\u53d1\u9001\u987a\u5e8f\u88ab\u6d88\u8d39\u3002<\/li>\n<li><strong>\u5206\u533a<\/strong>: \u6d88\u606f\u961f\u5217\u53ef\u4ee5\u5206\u533a\uff0c\u6bcf\u4e2a\u5206\u533a\u53ef\u4ee5\u5355\u72ec\u5904\u7406\u6d88\u606f\uff0c\u652f\u6301\u9ad8\u5e76\u53d1\u5904\u7406\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4e8b\u52a1\u6d88\u606f<\/strong>:<\/p>\n<ul>\n<li>\u652f\u6301\u5206\u5e03\u5f0f\u4e8b\u52a1\uff0c\u5141\u8bb8\u5728\u4e1a\u52a1\u903b\u8f91\u6267\u884c\u524d\u540e\u53d1\u9001\u6d88\u606f\uff0c\u4fdd\u8bc1\u6d88\u606f\u548c\u4e1a\u52a1\u64cd\u4f5c\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6d88\u606f\u8fc7\u6ee4<\/strong>:<\/p>\n<ul>\n<li><strong>Tag<\/strong>: \u6d88\u606f\u53ef\u4ee5\u9644\u5e26\u6807\u7b7e\uff0c\u6d88\u8d39\u8005\u53ef\u4ee5\u6839\u636e\u6807\u7b7e\u8fc7\u6ee4\u6d88\u606f\u3002<\/li>\n<li><strong>SQL92<\/strong>: \u901a\u8fc7 SQL92 \u8bed\u6cd5\u8fdb\u884c\u66f4\u590d\u6742\u7684\u6d88\u606f\u8fc7\u6ee4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u96c6\u7fa4\u548c\u9ad8\u53ef\u7528\u6027<\/strong>:<\/p>\n<ul>\n<li>RocketMQ \u652f\u6301\u96c6\u7fa4\u90e8\u7f72\u548c\u9ad8\u53ef\u7528\u6027\uff0c\u901a\u8fc7\u4e3b\u5907\u673a\u5236\u786e\u4fdd\u6d88\u606f\u7684\u53ef\u9760\u6027\u548c\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ba1\u7406\u4e0e\u76d1\u63a7<\/strong>:<\/p>\n<ul>\n<li>\u63d0\u4f9b\u7ba1\u7406\u754c\u9762\u548c\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u76d1\u63a7\u6d88\u606f\u7684\u53d1\u9001\u3001\u6d88\u8d39\u60c5\u51b5\u548c\u7cfb\u7edf\u6027\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u5e38\u89c1\u9762\u8bd5\u95ee\u9898\u53ca\u89e3\u7b54<\/h3>\n<ol>\n<li>\n<p><strong>RocketMQ \u7684\u6d88\u606f\u53d1\u9001\u6a21\u5f0f\u6709\u54ea\u4e9b\uff1f<\/strong><\/p>\n<ul>\n<li><strong>\u540c\u6b65\u53d1\u9001<\/strong>: \u751f\u4ea7\u8005\u53d1\u9001\u6d88\u606f\u540e\u7b49\u5f85\u670d\u52a1\u5668\u786e\u8ba4\uff0c\u4fdd\u8bc1\u6d88\u606f\u7684\u53ef\u9760\u6027\uff0c\u4f46\u53ef\u80fd\u4f1a\u6709\u5ef6\u8fdf\u3002<\/li>\n<li><strong>\u5f02\u6b65\u53d1\u9001<\/strong>: \u751f\u4ea7\u8005\u53d1\u9001\u6d88\u606f\u540e\u4e0d\u7b49\u5f85\u786e\u8ba4\uff0c\u800c\u662f\u5f02\u6b65\u5904\u7406\uff0c\u80fd\u591f\u63d0\u9ad8\u541e\u5410\u91cf\uff0c\u4f46\u9700\u8981\u5904\u7406\u53ef\u80fd\u7684\u6d88\u606f\u53d1\u9001\u5931\u8d25\u3002<\/li>\n<li><strong>\u5355\u5411\u53d1\u9001<\/strong>: \u751f\u4ea7\u8005\u53d1\u9001\u6d88\u606f\u540e\u4e0d\u5173\u5fc3\u6d88\u606f\u662f\u5426\u6210\u529f\uff0c\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53d1\u9001\u53ef\u9760\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>RocketMQ \u5982\u4f55\u4fdd\u8bc1\u6d88\u606f\u7684\u987a\u5e8f\u6027\uff1f<\/strong><\/p>\n<ul>\n<li>RocketMQ \u652f\u6301\u987a\u5e8f\u6d88\u606f\u7684\u5904\u7406\uff0c\u901a\u8fc7\u5c06\u6d88\u606f\u53d1\u9001\u5230\u76f8\u540c\u7684\u961f\u5217\u5206\u533a\u6765\u4fdd\u8bc1\u6d88\u606f\u7684\u987a\u5e8f\u6027\u3002\u6bcf\u4e2a\u5206\u533a\u5185\u7684\u6d88\u606f\u6309\u7167\u53d1\u9001\u987a\u5e8f\u6d88\u8d39\u3002<\/li>\n<li>\u540c\u4e00\u4e2a topic\u3001\u540c\u4e00\u4e2a Message Key \u4fdd\u8bc1\u53d1\u9001\u5230\u540c\u4e00\u4e2a\u961f\u5217\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4ec0\u4e48\u662f\u6d88\u606f\u7684\u6301\u4e45\u5316\uff1f\u5982\u4f55\u5b9e\u73b0\uff1f<\/strong><\/p>\n<ul>\n<li>\u6d88\u606f\u6301\u4e45\u5316\u662f\u6307\u5c06\u6d88\u606f\u5b58\u50a8\u5230\u78c1\u76d8\uff0c\u4ee5\u4fdd\u8bc1\u5373\u4f7f\u7cfb\u7edf\u5d29\u6e83\u4e5f\u4e0d\u4f1a\u4e22\u5931\u6d88\u606f\u3002RocketMQ \u901a\u8fc7\u5c06\u6d88\u606f\u5199\u5165\u78c1\u76d8\u7684\u65e5\u5fd7\u6587\u4ef6\u6765\u5b9e\u73b0\u6301\u4e45\u5316\uff0c\u4fdd\u8bc1\u6d88\u606f\u7684\u53ef\u9760\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>RocketMQ \u7684\u4e8b\u52a1\u6d88\u606f\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f<\/strong><\/p>\n<ul>\n<li>\u4e8b\u52a1\u6d88\u606f\u5206\u4e3a\u4e24\u9636\u6bb5\uff1a\u7b2c\u4e00\u9636\u6bb5\uff0c\u53d1\u9001\u534a\u6d88\u606f\uff1b\u7b2c\u4e8c\u9636\u6bb5\uff0c\u6267\u884c\u672c\u5730\u4e8b\u52a1\u5e76\u63d0\u4ea4\u6d88\u606f\u3002\u4e8b\u52a1\u6d88\u606f\u786e\u4fdd\u6d88\u606f\u53d1\u9001\u548c\u4e1a\u52a1\u64cd\u4f5c\u7684\u4e00\u81f4\u6027\u3002\u5982\u679c\u4e1a\u52a1\u64cd\u4f5c\u5931\u8d25\uff0c\u53ef\u4ee5\u56de\u6eda\u534a\u6d88\u606f\uff0c\u786e\u4fdd\u7cfb\u7edf\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>RocketMQ \u5982\u4f55\u5904\u7406\u6d88\u606f\u7684\u91cd\u590d\u6d88\u8d39\uff1f<\/strong><\/p>\n<ul>\n<li>RocketMQ \u901a\u8fc7\u6d88\u606f\u7684\u552f\u4e00 ID \u548c\u6d88\u8d39\u4f4d\u70b9\uff08offset\uff09\u6765\u786e\u4fdd\u6d88\u606f\u7684\u5e42\u7b49\u6027\u3002\u6d88\u8d39\u8005\u9700\u8981\u5904\u7406\u6d88\u606f\u7684\u5e42\u7b49\u6027\uff0c\u5373\u4f7f\u6d88\u606f\u88ab\u91cd\u590d\u6d88\u8d39\u4e5f\u4e0d\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5982\u4f55\u914d\u7f6e RocketMQ \u7684\u96c6\u7fa4\u90e8\u7f72\uff1f<\/strong><\/p>\n<ul>\n<li>\u914d\u7f6e RocketMQ \u7684\u96c6\u7fa4\u90e8\u7f72\u6d89\u53ca\u8bbe\u7f6e NameServer \u548c Broker \u5b9e\u4f8b\u3002NameServer \u7528\u4e8e\u670d\u52a1\u53d1\u73b0\u548c\u8def\u7531\u4fe1\u606f\uff0cBroker \u7528\u4e8e\u5b58\u50a8\u548c\u8f6c\u53d1\u6d88\u606f\u3002\u914d\u7f6e\u6587\u4ef6\u4e2d\u9700\u8981\u6307\u5b9a\u96c6\u7fa4\u540d\u79f0\u3001Broker \u7684\u89d2\u8272\uff08\u4e3b\u6216\u4ece\uff09\u548c\u8fde\u63a5\u53c2\u6570\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>RocketMQ \u7684\u6d88\u606f\u8fc7\u6ee4\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f<\/strong><\/p>\n<ul>\n<li>RocketMQ \u652f\u6301\u57fa\u4e8e Tag \u7684\u8fc7\u6ee4\u548c SQL92 \u8bed\u6cd5\u7684\u590d\u6742\u8fc7\u6ee4\u3002\u751f\u4ea7\u8005\u5728\u53d1\u9001\u6d88\u606f\u65f6\u53ef\u4ee5\u6307\u5b9a Tag\uff0c\u6d88\u8d39\u8005\u53ef\u4ee5\u6839\u636e Tag \u8fc7\u6ee4\u6d88\u606f\u3002\u590d\u6742\u7684\u6d88\u606f\u8fc7\u6ee4\u901a\u8fc7 SQL92 \u8bed\u6cd5\u5b9e\u73b0\uff0c\u4f8b\u5982\u6839\u636e\u6d88\u606f\u7684\u5c5e\u6027\u8fdb\u884c\u8fc7\u6ee4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5982\u4f55\u76d1\u63a7 RocketMQ \u7684\u8fd0\u884c\u72b6\u6001\uff1f<\/strong><\/p>\n<ul>\n<li>RocketMQ \u63d0\u4f9b\u4e86\u7ba1\u7406\u754c\u9762\u548c\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u5b9e\u65f6\u76d1\u63a7\u6d88\u606f\u7684\u53d1\u9001\u548c\u6d88\u8d39\u60c5\u51b5\u3002\u53ef\u4ee5\u67e5\u770b\u6d88\u606f\u7684\u961f\u5217\u3001\u4e3b\u9898\u3001Broker \u7684\u72b6\u6001\u3001\u6d88\u606f\u7684\u79ef\u538b\u60c5\u51b5\u7b49\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u4e86\u89e3\u8fd9\u4e9b\u77e5\u8bc6\u70b9\u548c\u5e38\u89c1\u95ee\u9898\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5728\u9762\u8bd5\u4e2d\u5c55\u793a\u5bf9 RocketMQ \u7684\u6df1\u5165\u7406\u89e3\uff0c\u540c\u65f6\u4e3a\u5b9e\u9645\u5e94\u7528\u4e2d\u7684 RocketMQ \u914d\u7f6e\u548c\u8c03\u4f18\u505a\u597d\u51c6\u5907\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u975e\u539f\u521b\u3001ChatGPT \u95ee\u7b54\u751f\u6210 RocketMQ \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u6d88\u606f\u961f\u5217\u7cfb\u7edf\uff0c\u4e3b\u8981\u7528\u4e8e\u9ad8\u541e\u5410\u91cf\u3001\u9ad8\u53ef\u9760\u6027\u7684\u6d88\u606f&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=6522\">\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-6522","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\/6522","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=6522"}],"version-history":[{"count":2,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6522\/revisions"}],"predecessor-version":[{"id":6524,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6522\/revisions\/6524"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}