tree: 46f7ab6a5545ec8a0123a150a0445ecc5967fae5 [path history] [tgz]
  1. src/
  2. .gitignore
  3. package.xml
  4. pom.xml
  5. README.md
rocketmq-replicator/README.md

rocketmq-replicator

rocketmq-replicator简介

image

Replicator用于RocketMQ集群之间的信息同步,作为一个connector运行在RocketMQ Runtime上之上, 能够同步两个独立的RocketMQ集群之间的消息。

中文文档

Replicator文档

快速开始


replicator使用说明

rocketmq-replicator打包

mvn clean install -Prelease-all -DskipTest -U 

打包成功后将rocketmq-replicator-0.1.0-SNAPSHOT-jar-with-dependencies.jar(fatjar)放到runtime配置的pluginPaths目录下

rocketmq-replicator启动

同步topic和消息

http://${runtime-ip}:${runtime-port}/connectors/${rocketmq-replicator-name}
?config={"connector-class":"org.apache.rocketmq.replicator.RmqSourceReplicator","source-rocketmq":"xxxx:9876","target-rocketmq":"xxxxxxx:9876","replicator-store-topic":"replicatorTopic","taskDivideStrategy":"0","white-list":"TopicTest,TopicTest2","task-parallelism":"2","source-record-converter":"org.apache.rocketmq.connect.runtime.converter.JsonConverter"}

rocketmq-replicator停止

http://${runtime-ip}:${runtime-port}/connectors/${rocketmq-replicator-name}/stop

rocketmq-meta-connector启动

同步消费消费进度和ConsumerGroup

注:此功能尚不成熟还需要后续版本优化

http://${runtime-ip}:${runtime-port}/connectors/${rocketmq-replicator-name}
?config={"connector-class":"org.apache.rocketmq.replicator.RmqMetaReplicator","source-rocketmq":"xxxx:9876","target-rocketmq":"xxxxxxx:9876","replicator-store-topic":"replicatorTopic","offset.sync.topic":"syncTopic","taskDivideStrategy":"0","white-list":"TopicTest,TopicTest2","task-parallelism":"2","source-record-converter":"org.apache.rocketmq.connect.runtime.converter.JsonConverter"}

rocketmq-rocketmq-connector停止

http://${runtime-ip}:${runtime-port}/connectors/${rocketmq-replicator-name}/stop

rocketmq-replicator参数说明

parametertypemustdescriptionsample value
source-rocketmqStringYesnamesrv address of source rocketmq cluster192.168.1.2:9876
target-rocketmqStringYesnamesrv address of target rocketmq cluster192.168.1.2:9876
target-clusterStringYestarget rocketmq cluster nameDefaultCluster
source-clusterStringYessource rocketmq cluster nameDefaultCluster
replicator-store-topicStringYestopic name to store all source messagesreplicator-store-topic
task-divide-strategyIntegerNotask dividing strategy, default value is 0 for dividing by topic0
white-listStringYestopic white list and multiple fields are separated by commastopic-1,topic-2
task-parallelismStringNotask parallelism,default value is 1,one task will be responsible for multiple topics for the value greater than 12
source-record-converterStringYessource data parserio.openmessaging.connect.runtime.converter.JsonConverter
topic.rename.formatStringYesrename topic name rulesrename-${topic} (${topic} represents the source topic name)