You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:53:31 UTC

[GitHub] [rocketmq] lwclover edited a comment on pull request #3295: production level pull api demo

lwclover edited a comment on pull request #3295:
URL: https://github.com/apache/rocketmq/pull/3295#issuecomment-910120162


   > 1. 从一个mq集群拉取消息发送到另外一个集群
   >    结果:tps 10w+
   > 
   > 最近也在实现跟你一样的功能。@lwclover 你的源和目标集群的规模是多大?同步的时候从源集群消费到发送到目标集群的时候是同步的吧?
   
   1.集群规模40+机器,日均消息量百亿级,但是不是所有topic都需要同步。
   2.拉取源集群消息之后是同步发送到目标集群,使用的是批量发送api。
   3.拉取源集群消息之后,注意去掉重试消息也就是reconsumeTimes>0的,然后在properties里去掉集群信息
   ```
   public List<Message> messageConvert(List<MessageExt> messageExts){
   	List<Message> result = new ArrayList<>(messageExts.size());
           for(MessageExt messageExt : messageExts){
           //有重试次数,说明是重试的消息
           if(messageExt.getReconsumeTimes() > 0){
   	        continue;
           }
           //清除集群信息,避免broker覆盖掉
           MessageAccessor.clearProperty(messageExt, MessageConst.PROPERTY_CLUSTER);
           result.add((Message) messageExt);
           }
           return result;
   }
   ```
   4.批量发送api需要注意的是不支持延迟消息,如果是延迟消息改为单条发送
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org