{"id":1734,"date":"2023-03-26T20:01:57","date_gmt":"2023-03-26T12:01:57","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1734"},"modified":"2023-04-23T21:31:56","modified_gmt":"2023-04-23T13:31:56","slug":"note-pitfalls-encountered-during-the-use-of-rocketmq-client-client","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/26\/note-pitfalls-encountered-during-the-use-of-rocketmq-client-client\/","title":{"rendered":"\u8bb0\u5728\u4f7f\u7528rocketmq client\u5ba2\u6237\u7aef\u8fc7\u7a0b\u4e2d\u8e29\u5230\u7684\u5751"},"content":{"rendered":"<h2>\u524d\u8a00<\/h2>\n<p>\u6700\u8fd1\u9879\u76ee\u4e2d\u4f7f\u7528\u963f\u91cc\u7684RocketMQ\u6765\u505a\u6d88\u606f\u961f\u5217\uff0c\u5177\u4f53\u600e\u4e48\u4f7f\u7528RocketMQ\u4e0d\u5728\u672c\u6587\u8ba8\u8bba\u8303\u56f4\u4e4b\u5185\uff0c\u5176\u76f8\u5173\u5e2e\u52a9\u6587\u6863\u53ef\u4ee5\u53c2\u8003\u5982\u4e0b\u94fe\u63a5<\/p>\n<blockquote>\n<p><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/help.aliyun.com\/product\/29530.html\">https:\/\/help.aliyun.com\/product\/29530.html<\/a><\/p>\n<\/blockquote>\n<p><!-- more --><\/p>\n<p>\u672c\u6587\u4e3b\u8981\u8bb0\u5f55\u5728\u4f7f\u7528rocketmq client\u65f6\uff0c\u9047\u5230\u7684\u4e00\u4e9b\u5751\uff0c\u4f5c\u8005\u91c7\u7528\u7684\u5ba2\u6237\u7aef\u7248\u672c\u662f4.5.0<\/p>\n<h2>\u8e29\u5230\u7684\u5751<\/h2>\n<h3>No route info of this topic<\/h3>\n<p>\u9047\u5230\u8fd9\u79cd\u60c5\u51b5\u7684\u539f\u56e0\u53ef\u80fd\u6709<\/p>\n<p>1\u3001<strong>Broker\u7981\u6b62\u81ea\u52a8\u521b\u5efaTopic\uff0c\u4e14\u7528\u6237\u6ca1\u6709\u901a\u8fc7\u624b\u5de5\u65b9\u5f0f\u521b\u5efaTopic<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5728\u542f\u52a8broker\u65f6\u52a0\u4e0a<code>autoCreateTopicEnable=true<\/code>\uff0c\u5982\u679c\u662f\u7528<code>broker.conf<\/code>\u542f\u52a8\uff0c\u6216\u8005\u96c6\u7fa4\u4f7f\u7528<code>broker-*<\/code>\u542f\u52a8\uff0c\u5f62\u5982\uff1a<\/p>\n<pre><code class=\"language-bash\">nohup sh \/oa\/other\/rocketmq\/bin\/mqbroker -c \/oa\/other\/rocketmq\/conf\/2m-noslave\/broker-a.properties &gt;\/dev\/null 2&gt;&amp;1 &amp;<\/code><\/pre>\n<p><code>broker-a.properties<\/code>\u914d\u7f6e\u6587\u4ef6\u4e2d\u52a0\u5165<\/p>\n<pre><code class=\"language-bash\">autoCreateTopicEnable=true<\/code><\/pre>\n<p>2\u3001<strong>Broker\u6ca1\u6709\u6b63\u786e\u8fde\u63a5\u5230Name Server<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u67e5\u770b<code>broker.log<\/code>\u65e5\u5fd7\u4fe1\u606f<\/p>\n<p>3\u3001<strong>Producer\u6ca1\u6709\u6b63\u786e\u8fde\u63a5\u5230Name Server<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5207\u6362\u5230rocketmq\u7684bin\u76ee\u5f55\uff0c\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">sh mqadmin clusterList -n \u5b89\u88c5rocketmqip\u5730\u5740:9876<\/code><\/pre>\n<p>\u5982\u679c\u51fa\u73b0<\/p>\n<pre><code class=\"language-bash\">#Cluster Name     #Broker Name    #BID  #Addr         #Version           #InTPS(LOAD)       #OutTPS(LOAD) #PCWait(ms)  #Hour     #SPACE\nDefaultCluster    broker-a        0     ip:10911      V4_5_0_SNAPSHOT    0.00(0,0ms)        0.00(0,0ms)   0 4          29243.32  0.2995<\/code><\/pre>\n<p>\u8bf4\u660e\u6b63\u5e38\u8fde\u63a5<\/p>\n<p>4\u3001<strong>\u9632\u706b\u5899\u539f\u56e0<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5173\u95ed\u9632\u706b\u5899\uff08\u751f\u4ea7\u73af\u5883\u4e0d\u5efa\u8bae\uff09\uff0c\u5f00\u653erocketmq\u7684\u76f8\u5e94\u7aef\u53e3\uff0c\u6216\u8005\u52a0\u5165\u76f8\u5e94\u7684\u53ef\u4ee5\u8bbf\u95eerocketmq\u7684ip<\/p>\n<p>5\u3001<strong>topic\u7684\u957f\u5ea6\u8fc7\u957f<\/strong><\/p>\n<p>\u8fd9\u4e2a\u6709\u5f85\u9a8c\u8bc1<\/p>\n<h3>connect to <ip:10909> failed<\/h3>\n<p><strong>\u4ea7\u751f\u539f\u56e0<\/strong>\uff1a<\/p>\n<p>rocketmq\u9ed8\u8ba4\u5f00\u542f\u4e86vip\u901a\u9053<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u4ee3\u7801\u5c42\u9762\u52a0\u5165<\/p>\n<pre><code class=\"language-java\">producer.setVipChannelEnabled(false);\nconsumer.setVipChannelEnabled(false);<\/code><\/pre>\n<h3>Send [3] times, still failed, cost [575]ms, Topic: Name, BrokersSent: [broker-a, broker-a, null]<\/h3>\n<pre><code class=\"language-bash\">2021-01-06 12:11:49.531 [ok-cloud-payment-channel][ ERROR] [3550] [nio-8850-exec-5] [5dc31eff8580fe06] [3edd0a589ccc2355] [true] --- [ok.cloud.payment.channel.helper.MQHelper] [sendPaymentCallbackMQ] [106] : MQ send exception Send [3] times, still failed, cost [11]ms, Topic: Topic_Channel_Callback, BrokersSent: [TEST-V101, TEST-V102, TEST-V103]\nSee http:\/\/rocketmq.apache.org\/docs\/faq\/ for further details.<\/code><\/pre>\n<p>1\u3001<strong>\u5982\u679c\u51fa\u73b0\u5f00\u59cb\u53d1\u9001\u6d88\u606f\u6210\u529f\uff0c\u6d88\u8d39\u8005\u63a5\u6536\u6d88\u606f\u540e\uff0c\u518d\u53d1\u9001\u6d88\u606f\u7684\u8bdd\uff0c\u51fa\u73b0\u4e0a\u8bc9\u5f02\u5e38\uff0c\u5219\u6709\u5f88\u5927\u6982\u7387\u662f\u673a\u5668\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<p>\uff081\uff09<code>df -lh<\/code>\u67e5\u770b\u78c1\u76d8\u7a7a\u95f4\u5927\u5c0f<br \/>\n\uff082\uff09<code>top<\/code>\u67e5\u770b<code>%MEM%<\/code>\u5360\u7528\u524d\u4e94\u7684\u8fdb\u7a0b<br \/>\n\uff083\uff09\u6309\u9700\u5220\u9664\u6ca1\u7528\u7684\u78c1\u76d8\u7a7a\u95f4<\/p>\n<p>2\u3001<strong>\u68c0\u67e5\u7f51\u7edc\u662f\u5426\u7545\u901a<\/strong><\/p>\n<p>\u6d88\u606f\u961f\u5217\u7f51\u7edc\u65b9\u9762\u7684\u6392\u67e5\uff0c\u8bf7\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/help.aliyun.com\/knowledge_detail\/6671409.html\">http:\/\/help.aliyun.com\/knowledge_detail\/6671409.html<\/a><\/p>\n<p>3\u3001<strong>\u5982\u679c\u662f\u4f7f\u7528\u865a\u62df\u673a\uff0c\u53ef\u80fd\u865a\u62df\u673a\u4e2d\u7684\u7f51\u7edc\u592a\u591a\uff0crocketMQ\u5728\u81ea\u52a8\u8bc6\u522b\u7f51\u7edc\u7684\u65f6\u5019\u8bc6\u522b\u9519\u8bef<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<p>\u53ef\u4ee5\u628a\u5176\u4ed6\u7f51\u7edcdown\u6389\uff0c\u6216\u8005\u628a\u60f3\u7528\u7684\u90a3\u4e2a\u7f51\u8ba9\u5b83\u6392\u5728\u524d\u9762<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u6700\u8fd1\u9879\u76ee\u4e2d\u4f7f\u7528\u963f\u91cc\u7684RocketMQ\u6765\u505a\u6d88\u606f\u961f\u5217\uff0c\u5177\u4f53\u600e\u4e48\u4f7f\u7528RocketMQ\u4e0d\u5728\u672c\u6587\u8ba8\u8bba\u8303\u56f4\u4e4b\u5185\uff0c\u5176\u76f8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-1734","post","type-post","status-publish","format-standard","hentry","category-rocketmq"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1734"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1734\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}