阿汤博客-承接中小企业服务器维护和网站维护,有意者可以联系博主!

canal无法连接阿里云rocketMQ解决办法

运维问题 1241℃ 0评论

最近项目升级中间件,把原来自建的开源rocketMQ升级到阿里云的商业rocketMQ,其中涉及到canal同步mysql,通过rocketMQ发送消息的问题。

在把配置替换为阿里云rocketMQ相关信息以后,无法正常发送消息,具体报错如下:

CANAL日志:

2020-04-23 08:02:52.785 [pool-6-thread-1] ERROR com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer – send flat message to fixed partition error

org.apache.rocketmq.client.exception.MQClientException: No route info for this topic, CANAL_SYNC

For more information, please visit the url, http://rocketmq.apache.org/docs/faq/

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:936) ~[rocketmq-client-4.3.0.jar:na]

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:907) ~[rocketmq-client-4.3.0.jar:na]

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:902) ~[rocketmq-client-4.3.0.jar:na]

at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:393) ~[rocketmq-client-4.3.0.jar:na]

at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:197) [canal.server-1.1.3.jar:na]

at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:75) [canal.server-1.1.3.jar:na]

at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:182) [canal.server-1.1.3.jar:na]

at com.alibaba.otter.canal.server.CanalMQStarter.access$500(CanalMQStarter.java:22) [canal.server-1.1.3.jar:na]

at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:224) [canal.server-1.1.3.jar:na]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181]

at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]

MQ日志

2020-04-23 08:08:51,051 WARN RocketmqClient – get Topic [CANAL_SYNC] RouteInfoFromNameServer is not exist value

2020-04-23 08:08:51,051 WARN RocketmqClient – updateTopicRouteInfoFromNameServer Exception

org.apache.rocketmq.client.exception.MQClientException: CODE: 17  DESC: No topic route info in name server for the topic: CANAL_SYNC

See http://rocketmq.apache.org/docs/faq/ for further details.

at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1233)

at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1203)

at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:613)

at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:500)

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.tryToFindTopicPublishInfo(DefaultMQProducerImpl.java:577)

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:920)

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:907)

at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:902)

at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:393)

at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:197)

at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:75)

at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:182)

at com.alibaba.otter.canal.server.CanalMQStarter.access$500(CanalMQStarter.java:22)

at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:224)

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)

一开始认为配置信息有问题,反复核对了accessKey、secretKey、producerGroup、namespace、topic、servers。确认无误以后,怀疑是canal不兼容现在的阿里云rocketMQ,咨询阿里云售后也是一些官方回复。

无意间发现canal有了新版本,抱着试试的态度,把原来的1.1.3升级到最新稳定版1.1.4版以后,测试正常。配置文件中还需要注意,把servers中的http://去掉,不然也无法连接到阿里云的rocketMQ

转载请注明:阿汤博客 » canal无法连接阿里云rocketMQ解决办法

喜欢 (0)or分享 (0)