开发者社区> 问答> 正文

对接阿里云rocketmq 提示topic is batch send , not support.

版本1.1.15 使用阿里云rocketmq,设置ak/sk后,启动后提示错误

Caused by: org.apache.rocketmq.client.exception.MQBrokerException: CODE: 1 DESC: the topic[binlog_prod_yaomaitong] is batch send , not support. For more information, please visit the url, http://rocketmq.apache.org/docs/faq/ at org.apache.rocketmq.client.impl.MQClientAPIImpl.processSendResponse(MQClientAPIImpl.java:671) ~[na:na] at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessageSync(MQClientAPIImpl.java:467) ~[na:na] at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:449) ~[na:na] at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:403) ~[na:na] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendKernelImpl(DefaultMQProducerImpl.java:831) ~[na:na] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:981) ~[na:na] at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:963) ~[na:na] at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:800) ~[na:na] at com.alibaba.otter.canal.connector.rocketmq.producer.CanalRocketMQProducer.sendMessage(CanalRocketMQProducer.java:303) ~[na:na]

了解后原因就是阿里云rocketmq不支持批量发送,请问这个如何解决?

原提问者GitHub用户ivancxj

展开
收起
山海行 2023-04-27 19:00:19 231 0
1 条回答
写回答
取消 提交回答
  • CanalRocketMQProducer类,334行

    SendResult sendResult = this.defaultMQProducer.send(messages, queue);

    改成

    for (Message message : messages) { sendMessage(message, partition); }

    原回答者GitHub用户ivancxj

    2023-04-28 13:53:13
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

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