版本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
CanalRocketMQProducer类,334行
SendResult sendResult = this.defaultMQProducer.send(messages, queue);
改成
for (Message message : messages) { sendMessage(message, partition); }
原回答者GitHub用户ivancxj
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。