使用RocketMQ发送消息出现这个错误。是说明没有手动创建topic,且没有自动创建topic
org.apache.rocketmq.client.exception.MQClientException: No route info of this topic, TopicTest
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:657)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1280)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1226)
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:283)
at org.apache.rocketmq.example.quickstart.Producer.main(Producer.java:67)
修改意见:
1、修改broker.conf文件,在文件中添加自动创建topic
autoCreateTopicEnable=true
2、升高MQ依赖配置,升到4.4.0或以上
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>4.4.0</version>
</dependency>
然后即可