开发者社区> 问答> 正文

canal不能使用阿里云提供的RocketMq

环境信息

canal version 1.1.3 mysql version 5.7

问题描述

1.阿里云购买的rocket不能再canal中使用,自己搭建的rocketmq可以收到消息,在canel.deployer时候出现以下异常

2019-06-29 14:58:36.507 [pool-4-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, DEV_CANAL_TRANS_BILL For more information, please visit the url, http://rocketmq.apache.org/docs/faq/ at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:1031) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:997) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:992) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:389) ~[rocketmq-client-4.3.0.jar:4.3.0] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:197) [classes/:na] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:75) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:182) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.access$500(CanalMQStarter.java:22) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:224) [classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_202] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_202] 2019-06-29 14:58:41.908 [pool-4-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, DEV_CANAL_TRANS_BILL For more information, please visit the url, http://rocketmq.apache.org/docs/faq/ at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:1031) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:997) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:992) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:389) ~[rocketmq-client-4.3.0.jar:4.3.0] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:197) [classes/:na] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:75) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:182) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.access$500(CanalMQStarter.java:22) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:224) [classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_202] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_202] 2019-06-29 14:58:45.429 [pool-4-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, DEV_CANAL_TRANS_BILL For more information, please visit the url, http://rocketmq.apache.org/docs/faq/ at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:1031) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:997) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:992) ~[rocketmq-client-4.3.0.jar:4.3.0] at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:389) ~[rocketmq-client-4.3.0.jar:4.3.0] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:197) [classes/:na] at com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer.send(CanalRocketMQProducer.java:75) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:182) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter.access$500(CanalMQStarter.java:22) [classes/:na] at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:224) [classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_202] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_202]

2.阿里云上这个匹配地址和阿里云上的地址不一致,代码在

org.apache.rocketmq.remoting.common.RemotingHelper#string2SocketAddress //eg. http://1592051318398515.mqrest.cn-qingdao-public.aliyuncs.com:80 //不能创建InetSocketAddress public static SocketAddress string2SocketAddress(final String addr) { String[] s = addr.split(":"); InetSocketAddress isa = new InetSocketAddress(s[0], Integer.parseInt(s[1])); return isa; }

原提问者GitHub用户ljz0721cx

展开
收起
云上静思 2023-05-04 12:11:42 221 0
1 条回答
写回答
取消 提交回答
  • 需要修改 server项目下的源码,将生产消息那段代码用ons-client改写 com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer

    原回答者GitHub用户zengcheng406

    2023-05-05 10:26:34
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
RocketMQ Client-GO 介绍 立即下载
RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载
基于 RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载