Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当broker配置autoCreateTopicEnable=false,rocketmq日志出现大量MQClientException: CODE: 17 #18

Open
ziyunmuxu opened this issue Apr 29, 2021 · 1 comment
Labels
question Further information is requested

Comments

@ziyunmuxu
Copy link

分析是对象池中MQClientInstance定时线程updateTopicRouteInfoFromNameServer,会默认扫描TBW102,但是对于broker配置autoCreateTopicEnable=false,并没有生成TBW102的topic,不知道这种的日志中不停出现告警信息,有什么处理方式没有?

具体告警日志如下:
2021-04-28 10:34:33 WARN MQClientFactoryScheduledThread - updateTopicRouteInfoFromNameServer Exception
org.apache.rocketmq.client.exception.MQClientException: CODE: 17 DESC: No topic route info in name server for the topic: TBW102
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1385)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1355)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:622)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:509)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:358)
at org.apache.rocketmq.client.impl.factory.MQClientInstance$3.run(MQClientInstance.java:275)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@gaoyf
Copy link
Collaborator

gaoyf commented Apr 29, 2021

两种解决方案
1.自己创建TBW102 topic。
2.修改rocketmq client的这行代码

this.topicPublishInfoTable.put(this.defaultMQProducer.getCreateTopicKey(), new TopicPublishInfo());

修改为如下即可:

if (defaultMQProducer.isFetchAutoCreateTopicRouteInfo()) {
    this.topicPublishInfoTable.put(this.defaultMQProducer.getCreateTopicKey(), new TopicPublishInfo());
}
在DefaultMQProducer定义一个变量
// 是否抓取自动创建topic的路由信息
private boolean fetchAutoCreateTopicRouteInfo;

另外,这个异常是由于#1985引入的,主要是这个代码:
image

我感觉官方merge代码时review不经过测试。。。,你这个问题应该在rocketmq社区提。

@gaoyf gaoyf added the question Further information is requested label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants