我正在使用apache-rocketmq发送消息,但是出现了异常。我尝试了csdn的许多解决方案,但是它不起作用。现在我不知道如何处理它。
这是一台Linux服务器,运行robotmq 4.2.0,java 8和tomcat 8。
2019-05-06 15:16:01,440 WARN RocketmqClient(256) - doRebalance, eventConsumer, but the topic[alarm_event] not exist.
2019-05-06 15:16:09,230 INFO RocketmqRemoting(454) - createChannel: begin to connect remote host[122.114.164.162:24314] asynchronously
2019-05-06 15:16:09,232 INFO RocketmqRemoting(615) - NETTY CLIENT PIPELINE: CONNECT UNKNOW => /122.114.164.162:24314
2019-05-06 15:16:12,232 WARN RocketmqRemoting(477) - createChannel: connect remote host[122.114.164.162:24314] timeout 3000ms, DefaultChannelPromise@59d7f51c(uncancellable)
2019-05-06 15:16:12,234 INFO RocketmqRemoting(640) - NETTY CLIENT PIPELINE: CLOSE
2019-05-06 15:16:12,234 INFO RocketmqRemoting(286) - closeChannel: the channel[122.114.164.162:24314] was removed from channel table
2019-05-06 15:16:12,234 INFO RocketmqRemoting(640) - NETTY CLIENT PIPELINE: CLOSE
2019-05-06 15:16:12,234 INFO RocketmqRemoting(280) - eventCloseChannel: the channel[null] has been removed from the channel table before
2019-05-06 15:16:12,235 INFO RocketmqRemoting(203) - closeChannel: close the connection to remote address[] result: true
2019-05-06 15:16:21,441 WARN RocketmqClient(256) - doRebalance, eventConsumer, but the topic[alarm_event] not exist.
2019-05-06 15:16:29,558 WARN RocketmqClient(1212) - get Topic [alarm_event] RouteInfoFromNameServer is not exist value
2019-05-06 15:16:29,558 WARN RocketmqClient(658) - updateTopicRouteInfoFromNameServer Exception
org.apache.rocketmq.client.exception.MQClientException: CODE: 17 DESC: No topic route info in name server for the topic: alarm_event
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1227)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1197)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:605)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:492)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:361)
at org.apache.rocketmq.client.impl.factory.MQClientInstance$3.run(MQClientInstance.java:278)
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)
最佳答案
您应该运行一个rocketmq-console-ng应用程序来管理您的主题,然后您可以创建要在程序中使用的主题。
rocketmq-console-ng的地址:https://github.com/apache/rocketmq-externals
关于java - 如何在RocketmqClient中修复“名称服务器中没有主题的主题路由信息”异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56001097/