rocketmq: No route info of this topic problem
clinet exception:
org.apache.rocketmq.client.exception.MQClientException: No route info of this topic, ffff
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:634)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1253)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1203)
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:214)
at com.xx.rmq.Producer.main(Producer.java:55)
rocketmq server config:
autoCreateTopicEnable=true
问题: 我们手动在rokcetmq中创建topic时,客户端访问时正常的,如果不提前手动创建将会出现上面的异常,如果需要让服务端自动创建topic,应该如何设置
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 37 (13 by maintainers)
历时一天终于跑起来了,回顾官网起步教程中存在的各种坑:
坑爹 # 1
启动 Broker
很遗憾,上述方式直接忽略指定 Name Server 的步骤,导致 Name Server 不知道 Broker 的存在。
解决方案
编辑
conf/broker.conf使用以下指令启动 Broker
坑爹 No route info of this topic # 2
RocketMQ 并不会自动创建 TopicTest,因此你必须手动创建该 Topic。
解决方案
坑爹 No route info of this topic # 3
还是遇到这个错误?! 你是不是参考了以下官方示例?
以上代码创建完成 Producer 之后,立即调用 shutdown(),导致异步操作失败,最终抛出一个风马牛不相及的异常
No route info of this topic:解决方案
注释掉
producer.shutdown();即可。坑爹 # 4
RocketMQ 内部代码一行注释看不到,我也是服气了。
hi~ @duhenglucky i am new to rocketmq. RocketMQ is cool and become more and more popular, so i’d like to help you guys to make the quick start more friendly to newbies like me. If there are some errors in my statement, please point out. here we go, after some investigation, these are what i find:
-n locolhost:9876set the name server.As that’s a quick start, if you can put that in configuration file by default, that will be really nice.No route info of this topic problemerror. If i use the same 4.3.0 version client as the official site Simple Example page suggests, the broker(version 4.4.0) won’t create topic automatically. however 4.4.0 version client works! My suggestions are:autoCreateTopicEnable = trueto broker config file by defaultproducer.setNamesrvAddr("localhost:9876")-Xms8g -Xmx8g -Xmn4g, that’s almost kill my poor computer… i think you can make it smaller for our poor personal computer~ The professional company guys will configure that option by themselves.关于官网的``可以参考这里:https://exception.site/question/101
居然是没有添加 Name Server 的地址导致的。同问官网的demo都没有自己运行吗?
用阿里云服务器的同学,如果rocketmq和你的微服务不在一台阿里云服务器上,那很有可能是阿里云使用内网IP的缘故导致
No route info of this topic, TopicTest不能自动创建topic,把rocketmq和微服务放一台服务器就好了,这问题真·排到怀疑人生= =@jimgreen2013 The pr#1415 does not modify the code of broker, but the code of client. So you should test with the newest client code in develop branch.
hi~ @jimgreen2013
autoCreateTopicEnable = true, the new modification will still returnNo route info of this topic. My improvement is mainly for “No route info of tihis topic” caused by some network problem.强烈建议重开此 issue。