{"id":10006955,"date":"2022-12-14T17:03:11","date_gmt":"2022-12-14T09:03:11","guid":{"rendered":"https:\/\/ityet.com\/?p=10006955"},"modified":"2022-12-14T17:03:11","modified_gmt":"2022-12-14T09:03:11","slug":"%e4%b8%8erabbitmq%e6%9c%89%e5%85%b3%e7%9a%84%e4%b8%80%e4%ba%9b%e7%9f%a5%e8%af%86","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006955","title":{"rendered":"\u4e0eRabbitMQ\u6709\u5173\u7684\u4e00\u4e9b\u77e5\u8bc6"},"content":{"rendered":"<blockquote><p>\u5de5\u4f5c\u4e2d\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684Kafka\uff0c\u4e0d\u8fc7\u4e3b\u8981\u8fd8\u662fRabbitMQ\u7528\u7684\u591a\u4e00\u4e9b\u3002\u4eca\u5929\u4e3b\u8981\u6765\u8bb2\u8bb2\u4e0eRabbitMQ\u76f8\u5173\u7684\u4e00\u4e9b\u77e5\u8bc6\u3002\u4e00\u4e9b\u57fa\u672c\u6982\u5ff5\uff0c\u4ee5\u53ca\u5b9e\u9645\u4f7f\u7528\u573a\u666f\u53ca\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879\u3002<\/p><\/blockquote>\n<h3>1 \u57fa\u672c\u6982\u5ff5<\/h3>\n<p>RabbitMQ\u4f7f\u7528Erlang\u5f00\u53d1\uff0c\u5b9e\u73b0\u4e86\u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae(AMQP)\uff0c\u540c\u65f6\u8fd8\u652f\u6301MQTT\u3001STOMP\u7b49\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4TGr\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h4>1.1 \u6838\u5fc3\u6982\u5ff5<\/h4>\n<ul>\n<li>Broker: \u6d88\u606f\u961f\u5217\u670d\u52a1\u4e3b\u673a<\/li>\n<li>Exchange: \u6d88\u606f\u4ea4\u6362\u673a\uff0c\u53ef\u6309\u7167\u7279\u5b9a\u89c4\u5219\u5c06\u6d88\u606f\u8def\u7531\u5230\u5177\u4f53\u961f\u5217 (\u4e0a\u56fe<code>X<\/code>\u5373\u4e3a\u4ea4\u6362\u673a)<\/li>\n<li>Queue: \u6d88\u606f\u961f\u5217\uff0c\u6bcf\u4e2a\u6d88\u606f\u7406\u8bba\u90fd\u8981\u88ab\u6295\u5165\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u961f\u5217 (\u4e0a\u56fe\u7ea2\u8272\u77e9\u5f62\u5373\u4e3a\u961f\u5217)<\/li>\n<li>Binding: \u7ed1\u5b9a\u5173\u7cfb\uff0c\u5c06<code>Exchange<\/code>\u548c<code>Queue<\/code>\u6309\u7167\u67d0\u4e2a\u8def\u7531\u89c4\u5219\u8fdb\u884c\u7ed1\u5b9a<\/li>\n<li>RoutingKey: \u8def\u7531\u5173\u952e\u5b57\uff0c<code>Exchange<\/code>\u6839\u636e\u8be5Key\u8fdb\u884c\u4e0d\u540c\u7684\u8def\u7531<\/li>\n<li>Vhost: \u865a\u62df\u4e3b\u673a\uff0c\u5728\u540c\u4e00\u7269\u7406\u4e3b\u673a\u4e0a\u505a\u8d44\u6e90\u903b\u8f91\u9694\u79bb\uff0c\u7c7b\u4f3c<code>\u547d\u540d\u7a7a\u95f4?<\/code><\/li>\n<li>Connection: \u5ba2\u6237\u7aef\u4e0e\u4e3b\u673a\u5efa\u7acb\u7684TCP\u8fde\u63a5<\/li>\n<li>Channel: \u6d88\u606f\u901a\u9053\uff0c\u540c\u4e00<code>Connection<\/code>\u53ef\u4ee5\u6709\u591a\u4e2a<code>Channel<\/code>\uff0c\u6bcf\u4e2a<code>Channel<\/code>\u90fd\u6709\u4e00\u4e2a\u552f\u4e00ID<\/li>\n<\/ul>\n<h4>1.2 \u4ea4\u6362\u673a<\/h4>\n<p>\u6309\u7c7b\u578b\u5206\u56db\u79cd\uff1aDirect Exchange\uff0cTopic Exchage\uff0cFanout Exchange\uff0cHeaders Exchange<\/p>\n<h5>1.2.1 Direct Exchange<\/h5>\n<p>\u76f4\u63a5\u4ea4\u6362\u673a\uff0c\u5728\u6ca1\u590d\u6742\u8def\u7531\u573a\u666f\u65f6\uff0c\u8fd9\u79cd\u8def\u7531\u5668\u4f7f\u7528\u7684\u8f83\u591a\u3002\u7279\u70b9\u662f<code>\u4e25\u683cRoutingKey<\/code>\u8def\u7531\u3002\u53ea\u6709\u5f53<code>RoutingKey<\/code>\u5b8c\u5168\u4e00\u81f4\u65f6\uff0c\u624d\u4f1a\u4eca\u5929\u8def\u7531\u6295\u9012\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4TGG\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h5>1.2.2 Fanout Exchange<\/h5>\n<p>\u5e7f\u64ad\u4ea4\u6362\u673a\uff0c\u4e00\u4e2a\u6d88\u606f\u9700\u8981\u65e0\u5dee\u522b\u6295\u9012\u5230\u6240\u6709\u7ed1\u5b9a\u7684\u961f\u5217\u4e2d\u65f6\u3002\u65e0\u9700\u8bbe\u7f6e<code>RoutingKey<\/code>\uff0c\u5373\u4f7f\u8bbe\u7f6e\u4e86\u4e5f\u4e0d\u4f1a\u751f\u6548\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4T89\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h5>1.2.3 Topic Exchange<\/h5>\n<p>\u4e3b\u9898\u4ea4\u6362\u673a\uff0c\u7c7b\u4f3c\u76f4\u63a5\u4ea4\u6362\u673a\u3002\u4e0d\u540c\u7684\u662f\u53ef\u4ee5\u6839\u636e<code>RoutingKey<\/code>\u8fdb\u884c\u6a21\u7cca\u5339\u914d(<code>#<\/code>\u8868\u793a\u4e00\u4e2a\u6216\u591a\u4e2a\u5355\u8bcd\uff0c<code>*<\/code>\u8868\u793a\u4e00\u4e2a\u5355\u8bcd)\u3002<\/p>\n<p>\u8fd9\u6837\u6765\u770b\u7684\u8bdd\u3002<\/p>\n<ul>\n<li>\u5f53\u4e0d\u4f7f\u7528<code>#<\/code>\u6216<code>*<\/code>\u8fdb\u884c\u6a21\u7cca\u5339\u914d\u65f6\uff0c\u5b83\u8ddf<code>Direct Exchange<\/code>\u4f3c\u4e4e\u6ca1\u5565\u533a\u522b\u3002<\/li>\n<li>\u5f53\u4ec5\u4f7f\u7528<code>#<\/code>\u8fdb\u884c\u6a21\u7cca\u5339\u914d\u65f6\uff0c\u5b83\u8ddf<code>Fanout Exchange<\/code>\u4f3c\u4e4e\u4e5f\u6ca1\u5565\u533a\u522b\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4TPR\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\uff1a<\/p>\n<ul>\n<li><code>Q1<\/code>\u53ef\u4ee5\u5339\u914d\uff1a<code>x11.orange.x22<\/code>\uff0c\u4f46\u65e0\u6cd5\u5339\u914d<code>x00.x11.orange.x22<\/code>\u3002<\/li>\n<li><code>Q2<\/code>\u53ef\u4ee5\u5339\u914d\uff1a<code>lazy.orange<\/code>\uff0c\u4e5f\u80fd\u5339\u914d<code>lazy.orange.rabbit<\/code>\u3002<\/li>\n<\/ul>\n<h5>1.2.4 Headers Exchange<\/h5>\n<p>\u8bf7\u6c42\u5934\u4ea4\u6362\u673a\uff0c\u4e0d\u4f7f\u7528<code>RoutingKey<\/code>\u8def\u7531\uff0c\u6839\u636e\u6d88\u606f\u5934\u4e2d\u7684<code>key-value<\/code>\u5c5e\u6027\u8fdb\u884c\u8def\u7531\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4UiN\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<code>x-match: any<\/code>\u3001<code>x-match: all<\/code>\u6765\u8fdb\u884c<code>or<\/code>\u3001<code>and<\/code>\u903b\u8f91\u5339\u914d\u3002<\/p>\n<h5>1.2.5 \u5176\u4ed6\u5c5e\u6027<\/h5>\n<ul>\n<li>Durability: Durable(\u6301\u4e45\u7684)\uff0cTransiant(\u77ed\u6682\u7684)\u3002<\/li>\n<li>Auto delete\uff1a\u5f53\u6709\u961f\u5217\u6216\u4ea4\u6362\u673a\u7ed1\u5b9a\u4e86\u672c\u4ea4\u6362\u673a\uff0c\u5728\u961f\u5217\u6216\u8005\u4ea4\u6362\u673a\u90fd\u53c8\u8fdb\u884c\u4e86\u89e3\u7ed1\u540e\uff0c\u81ea\u52a8\u5220\u9664<\/li>\n<li>Internal: \u662f\u5426\u4e3a\u5185\u90e8\u4f7f\u7528\u3002true \u8868\u793a\u4e3a\u5185\u90e8\u4ea4\u6362\u673a\uff0c\u5ba2\u6237\u7aef\u65e0\u6cd5\u76f4\u63a5\u5411\u8be5\u4ea4\u6362\u673a\u53d1\u9001\u6d88\u606f\u3002<\/li>\n<li>\n<p>Arguments:<\/p>\n<ul>\n<li>alternate-exchange: \u5907\u4efd\u4ea4\u6362\u673a\uff0c\u5f53\u6d88\u606f\u65e0\u6cd5\u8def\u7531\u5230\u5177\u4f53\u961f\u5217\u65f6\uff0c\u5c06\u4ea4\u7ed9\u5907\u4efd\u4ea4\u6362\u673a\u5904\u7406\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>1.3 \u961f\u5217<\/h4>\n<p>\u6d88\u606f\u53ea\u80fd\u5b58\u5728\u4e8e\u961f\u5217\u4e2d\uff0c\u4e0b\u9762\u770b\u4e00\u4e0b\u961f\u5217\u90fd\u6709\u54ea\u4e9b\u5c5e\u6027\u3002<\/p>\n<ul>\n<li>Type: Classic\uff0cQuorum<\/li>\n<li>Durability: Durable(\u6301\u4e45\u7684)\uff0cTransiant(\u77ed\u6682\u7684)<\/li>\n<li>Auto delete: \u5f53\u6709\u6d88\u8d39\u8005\u8ba2\u9605\uff0c\u7136\u540e\u6240\u6709\u7684\u6d88\u8d39\u8005\u53c8\u90fd\u65ad\u5f00\u8fde\u63a5\uff0c\u5219\u81ea\u52a8\u5220\u9664<\/li>\n<li>\n<p>Arguments:<\/p>\n<ul>\n<li>x-message-ttl: <code>Message<\/code>\u5728<code>Queue<\/code>\u4e2d\u5b58\u6d3b\u65f6\u95f4\uff0c\u8d85\u65f6\u5c06\u88ab\u4e22\u5f03<\/li>\n<li>x-expires: <code>Queue<\/code>\u5728\u6ca1\u6709\u88ab\u4f7f\u7528\u7684\u60c5\u51b5\u4e0b\uff0c\u8fc7\u671f\u65f6\u95f4<\/li>\n<li>x-max-length: <code>Queue<\/code>\u4e2d\u53ef\u4ee5\u5b58\u653e\u7684\u6700\u5927\u6d88\u606f\u6570\uff0c\u8d85\u8fc7\u5c06\u88ab\u4e22\u5f03<\/li>\n<li>x-max-length-bytes: <code>Queue<\/code>\u4e2d\u53ef\u4ee5\u5b58\u653e\u6700\u5927\u6d88\u606f\u4f53\u5927\u5c0f\uff0c\u8d85\u8fc7\u5c06\u88ab\u4e22\u5f03<\/li>\n<li>x-overflow: <code>Queue<\/code>\u6ea2\u51fa\u540e\u7684\u884c\u4e3a\uff0c<code>drop-head<\/code>\u3001<code>reject-publish<\/code>\u3001<code>reject-publish-dlx<\/code>\u3002<\/li>\n<li>x-single-active-consumer: \u786e\u4fdd\u53ea\u6709\u4e00\u4e2a\u6d88\u8d39\u8005\u8ba2\u9605\uff0c\u5f53\u51fa\u73b0\u5f02\u5e38\u65f6\u81ea\u52a8\u8f6c\u5411\u53e6\u5916\u4e00\u4e2a\u3002<\/li>\n<li>x-max-priority: \u961f\u5217\u652f\u6301\u7684\u6700\u5927\u4f18\u5148\u7ea7\uff0c\u4e0d\u8bbe\u7f6e\u5c06\u4e0d\u652f\u6301\u3002<\/li>\n<li>x-dead-letter-exchange: \u5f53<code>Message<\/code>\u88ab<code>rejected<\/code>\u6216<code>expire<\/code>\u65f6\uff0c\u5c06\u4f1a\u88ab\u91cd\u65b0\u53d1\u5e03\u5230\u54ea\u4e2a\u4ea4\u6362\u673a\u3002<\/li>\n<li>x-dead-letter-routing-key: \u5f53\u6210\u4e3a\u6b7b\u4fe1\u65f6\uff0c\u4f7f\u7528\u7684<code>RoutingKey<\/code>\uff0c\u672a\u8bbe\u7f6e\u65f6\u5219\u4f7f\u7528\u539f\u59cb<code>Key<\/code>\u3002<\/li>\n<li>x-queue-mode: \u5f53\u8bbe\u7f6e\u4e3a<code>lazy<\/code>\u65f6\uff0c\u4f1a\u5c06\u6d88\u606f\u5c3d\u53ef\u80fd\u7684\u653e\u7f6e\u5230\u78c1\u76d8\u4e0a\uff0c\u4ee5\u51cf\u5c11\u5185\u5b58\u4f7f\u7528\u3002<\/li>\n<li>x-queue-master-locator: \u5c06\u961f\u5217\u8bbe\u7f6e\u4e3a\u4e3b\u8282\u70b9\u5b9a\u4f4d\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>2 \u4f7f\u7528\u573a\u666f<\/h3>\n<p>\u5e94\u7528\u573a\u666f\u4e00\u822c\u4e3a\u4e09\u7c7b: \u5f02\u6b65\u3001\u89e3\u8026\u3001\u524a\u5cf0\u586b\u8c37\u3002<\/p>\n<h4>2.1 \u5f02\u6b65<\/h4>\n<p>\u5f02\u6b65\u4e00\u822c\u662f\u6307: \u540c\u4e00\u4e2a\u7cfb\u7edf\u5185\uff0c\u4f7f\u7528\u961f\u5217\u5c06\u8bf7\u6c42\u548c\u54cd\u5e94\u5f02\u6b65\u5316\uff0c\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\uff0c\u4ece\u800c\u83b7\u5f97\u66f4\u9ad8\u7684\u5904\u7406\u901f\u5ea6\uff0c\u4ee5\u63d0\u5347\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<p>\u6700\u65e9\u5728\u505a\u5546\u57ce\u9879\u76ee\u65f6\u3002\u7528\u6237\u4e0b\u5355\u4ed8\u6b3e\u540e\u5148\u66f4\u65b0\u672c\u5730\u8ba2\u5355\u8bb0\u5f55\uff0c\u7136\u540e\u518d\u5411\u7b2c\u4e09\u65b9\u7269\u6d41\u7cfb\u7edf\u63a8\u9001\u5f85\u53d1\u8d27\u6d88\u606f\u3001\u5411\u7528\u6237\u53d1\u653e\u8ba2\u5355\u76f8\u5173\u7ad9\u5185\u4fe1\u3001\u5e76\u53ef\u80fd\u89e6\u53d1\u79ef\u5206\u8d60\u9001\u53ca\u63a8\u8350\u4eba\u7684\u8fd4\u5229\u8ba1\u7b97\u3001\u4ee5\u53ca\u53ef\u80fd\u89e6\u53d1\u76f8\u5173\u8425\u9500\u89c4\u5219\u53d1\u653e\u4f18\u60e0\u5238\u7b49\u64cd\u4f5c\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4Uxx\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h4>2.2 \u89e3\u8026<\/h4>\n<p>\u89e3\u8026\u4e00\u822c\u6307: \u4e0d\u540c\u7cfb\u7edf\u95f4\uff0c\u901a\u8fc7\u961f\u5217\u65b9\u5f0f\u8fdb\u884c\u901a\u4fe1\uff0c\u4f7f\u7cfb\u7edf\u95f4\u4e0d\u81f3\u4e8e\u8fc7\u5ea6\u4f9d\u8d56\uff0c\u51cf\u5c11\u7cfb\u7edf\u95f4\u8026\u5408\u6027\u3002<\/p>\n<p>\u5728\u6700\u8fd1\u7684\u9879\u76ee\u4e2d\uff0c\u6709\u505a\u7684\u4e00\u4e2a\u4e8b\u4ef6\u4e0a\u62a5\u7cfb\u7edf\uff0c\u5176\u5b9e\u5c31\u662f\u5404\u4e2a\u7cfb\u7edf\u90fd\u63a5\u5165\u3002\u6bcf\u4e2a\u7cfb\u7edf\u5373\u53ef\u505a\u751f\u4ea7\u8005\u3001\u4e5f\u53ef\u4ee5\u505a\u6d88\u8d39\u8005\u3002\u6bd4\u5982\u7528\u6237\u5728\u4e0b\u5355\u540e\uff0c\u9700\u8981\u7ed9\u63a8\u8350\u4eba\u8d60\u9001\u79ef\u5206\u3001\u5411\u5916\u90e8CRM\u540c\u6b65\u5546\u673a\u5df2\u6210\u5355\u72b6\u6001\u7b49\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4Uz1\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h4>2.3 \u524a\u5cf0\u586b\u8c37<\/h4>\n<p>\u524a\u5cf0\u586b\u8c37\u4e00\u822c\u6307: \u5229\u7528\u961f\u5217\u4f5c\u4e3a\u7f13\u51b2\uff0c\u5c06\u77ed\u65f6\u5927\u6d41\u91cf\u7f13\u5b58\u8d77\u6765\uff0c\u7531\u6d88\u8d39\u8005\u6765\u51b3\u5b9a\u5904\u7406\u901f\u5ea6\u3002\u4f7f\u5f97\u7cfb\u7edf\u8d1f\u8f7d\u8d8b\u4e8e\u5e73\u7a33\uff0c\u4ece\u800c\u63d0\u9ad8\u7cfb\u7edf\u7a33\u5b9a\u6027\u3002<\/p>\n<p>\u5728\u505a\u7528\u6237\u589e\u957f\u4e1a\u52a1\u76f8\u5173\uff0c\u7528\u6237\u7531\u843d\u5730\u9875\u63d0\u4ea4\u6570\u636e\u81f3\u5185\u90e8\u7cfb\u7edf\uff0c\u5185\u90e8\u7cfb\u7edf\u4f1a\u5c06\u6570\u636e\u7b80\u5355\u5904\u7406\u540e\u63a8\u9001\u5230\u5916\u90e8CRM\u7cfb\u7edf\uff0c\u9500\u552e\u5728\u8ddf\u5ba2\u6237\u6c9f\u901a\u540e\uff0c\u4f1a\u5c06\u7ebf\u7d22\u8f6c\u6362\u4e3a\u5546\u673a\u3002\u5728\u8fd9\u4e2a\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u7531CRM\u5411\u5185\u90e8\u7cfb\u7edf\u63a8\u9001\u6570\u636e\u3002\u5185\u90e8\u7cfb\u7edf\u4f1a\u6839\u636e\u4f20\u9012\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c\uff0c\u5982\u521b\u5efa\u3001\u66f4\u65b0\u5bb6\u957f\uff0c\u521b\u5efa\u3001\u66f4\u65b0\u5b66\u751f\uff0c\u4ee5\u53ca\u5404\u79cd\u9644\u52a0\u4e1a\u52a1\u4fe1\u606f\u7b49\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4UxL\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h3>3 \u5e38\u89c1\u95ee\u9898<\/h3>\n<h4>3.1 \u6d88\u606f\u91cd\u590d\u95ee\u9898<\/h4>\n<p>\u6d88\u606f\u91cd\u590d\u7684\u573a\u666f\u5f88\u591a\uff0c\u6bd4\u5982\u7cfb\u7edf\u51fa\u9519\u3001\u8c03\u7528\u8d85\u65f6\u91cd\u8bd5\u673a\u5236\u3001\u6d88\u606f\u6d88\u8d39\u5f02\u5e38\u65f6<code>ReQueue<\/code>\u64cd\u4f5c\u7b49\u60c5\u51b5\u3002\u5f88\u591a\u65f6\u5019\u4e3a\u4e86\u4fdd\u8bc1\u6d88\u606f\u7684\u53ef\u9760\u4f20\u9012\uff0c\u4f1a\u4fdd\u8bc1\u6d88\u606f<code>at-least-once<\/code>\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\u57fa\u672c\u65e0\u6cd5\u4fdd\u8bc1\u4e0d\u91cd\u590d\u53d1\u9001\uff0c\u6240\u4ee5\u6d88\u8d39\u7aef\u8981\u4fdd\u8bc1\u5e42\u7b49\u6027\u3002<\/p>\n<p>\u65e2\u7136\u63d0\u5230\u91cd\u590d\u6027\uff0c\u5fc5\u7136\u8981\u6709\u91cd\u590d\u7684\u4f9d\u636e\u3002\u6bd4\u5982\u8ba2\u5355\u53f7\uff0c\u540c\u4e00\u7cfb\u7edf\u5185\u4e0d\u5141\u8bb8\u91cd\u590d\u3002<\/p>\n<ul>\n<li>\u53ef\u501f\u52a9\u6570\u636e\u5e93\u7684<code>\u552f\u4e00\u7d22\u5f15<\/code>\uff0c\u4e5f\u53ef\u501f\u52a9Redis\u6765\u4fdd\u8bc1\u6570\u636e\u552f\u4e00\u3002<\/li>\n<li>\u5982\u679c\u6ca1\u6709\u91cd\u590d\u4f9d\u636e\uff0c\u53ea\u80fd\u5927\u6982\u6839\u636e\u53c2\u6570\u503c\u6309\u4e00\u5b9a\u89c4\u5219\u505a\u54c8\u5e0c\u5904\u7406\uff0c\u4e0d\u8fc7\u8fd9\u79cd\u53ef\u80fd\u5b58\u5728\u8bef\u5224\u548c\u6f0f\u5224\u95ee\u9898\u3002<\/li>\n<\/ul>\n<h4>3.2 \u6d88\u606f\u5806\u79ef<\/h4>\n<p>\u6d88\u8d39\u5806\u79ef\uff0c\u65e0\u975e\u5c31\u662f\u6d88\u8d39\u901f\u5ea6\u8d76\u4e0d\u4e0a\u751f\u4ea7\u901f\u5ea6\u3002\u4ea7\u751f\u7684\u539f\u56e0\u6709\u5f88\u591a\uff0c\u6d88\u8d39\u8005\u5f02\u5e38\u51fa\u73b0\u6d88\u8d39\u53d8\u6162\u95ee\u9898\u3001\u751f\u4ea7\u8005\u7a81\u53d1\u5927\u6d41\u91cf\u7b49\u60c5\u51b5\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848\u8981\u540c\u65f6\u8003\u8651\u751f\u4ea7\u8005\u548c\u6d88\u8d39\u8005\u3002\u53d1\u751f\u5806\u79ef\u65f6\uff0c\u5c06\u90e8\u5206\u751f\u4ea7\u8005\u964d\u7ea7\uff0c\u5173\u95ed\u975e\u6838\u5fc3\u4e1a\u52a1\uff0c\u51cf\u5c11\u6d88\u606f\u4ea7\u751f\u3002\u6d88\u8d39\u8005\u4f18\u5316\u6027\u80fd\uff0c\u5c06\u5806\u79ef\u6d88\u606f\u4e34\u65f6\u8f6c\u79fb\u81f3\u65b0\u961f\u5217\uff0c\u542f\u7528\u65b0\u7684\u6d88\u8d39\u8005\u53bb\u6d88\u8d39\u3002<\/p>\n<h4>3.3 \u6d88\u606f\u4e22\u5931\u95ee\u9898<\/h4>\n<p>\u4ece\u6574\u4e2a\u6d41\u7a0b\u8003\u8651\uff0c\u751f\u4ea7\u8005\u3001\u961f\u5217\u3001\u6d88\u8d39\u8005\u4e09\u65b9\u9762\u3002<\/p>\n<ul>\n<li>\u751f\u4ea7\u8005: \u4fdd\u8bc1\u6d88\u606f\u6210\u529f\u63a8\u9001\u5230\u961f\u5217\u3002<\/li>\n<li>\u961f\u5217: \u4fdd\u8bc1\u5df2\u63a8\u9001\u5230\u961f\u5217\u4e2d\u7684\u6570\u636e\u4e0d\u4f1a\u4e22\u5931\u3002<\/li>\n<li>\u6d88\u8d39\u8005: \u4fdd\u8bc1\u5df2\u6d88\u8d39\u7684\u6570\u636e\u88ab\u6b63\u786e\u5904\u7406\u3002<\/li>\n<\/ul>\n<h3>4 \u540e\u8bb0<\/h3>\n<p>\u7cfb\u7edf\u8bbe\u8ba1\u6ca1\u6709\u94f6\u5f39\u3002\u5728\u5f15\u5165\u4e00\u4e2a\u4e2d\u95f4\u4ef6\u65f6\uff0c\u8981\u7efc\u5408\u8003\u8651\u3001\u6743\u8861\u5229\u5f0a\u3002\u5f15\u5165\u4e2d\u95f4\u4ef6\uff0c\u80fd\u89e3\u51b3\u4e00\u4e9b\u95ee\u9898\uff0c\u4f46\u53ef\u80fd\u4f1a\u5e26\u6765\u66f4\u591a\u7684\u95ee\u9898\u3002<\/p>\n<p>\u505a\u597d\u7cfb\u7edf\u76d1\u63a7\uff0c\u50cf\u6d88\u8d39\u5806\u79ef\u6709\u4e9b\u573a\u666f\u4e0b\u662f\u53ef\u9884\u77e5\u7684\uff0c\u6bd4\u5982\u4e34\u65f6\u505a\u6d3b\u52a8\u6216\u8005\u4f4e\u4ef7\u4fc3\u9500\u4e4b\u7c7b\u9020\u6210\u7684\u8ba2\u5355\u6fc0\u589e\u3002\u800c\u6709\u4e9b\u50cf\u7cfb\u7edf\u6545\u969c\u7c7b\uff0c\u65e0\u6cd5\u63d0\u524d\u9884\u77e5\uff0c\u5219\u9700\u8981\u76d1\u63a7\u7cfb\u7edf\u505a\u5230\u53ca\u65f6\u544a\u8b66\uff0c\u63d0\u524d\u4ecb\u5165\u5904\u7406\u3002<\/p>\n<hr>\n<pre><code class=\"sh\">echo '5Y6f5Yib5paH56ugOiDmjpjph5Eo5L2g5oCO5LmI5Zad5aW26Iy25ZWKWzkyMzI0NTQ5NzU1NTA4MF0pL+aAneWQpihscGUyMzQp' | base64 -d<\/code><\/pre>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043077665\">https:\/\/segmentfault.com\/a\/1190000043077665<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5de5\u4f5c\u4e2d\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684Kafka\uff0c\u4e0d\u8fc7\u4e3b\u8981\u8fd8\u662fRabbitMQ\u7528\u7684\u591a\u4e00\u4e9b\u3002\u4eca\u5929\u4e3b\u8981\u6765\u8bb2\u8bb2\u4e0eRabbitMQ\u76f8\u5173\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10006955","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006955"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006955\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}