oudb commented on issue #286:
URL:
https://github.com/apache/rocketmq-connect/issues/286#issuecomment-1226716124
MessageQueue的brokerName可以编码到TopicPartition的topic或者partition。
方案一:当前版本编码到TopicPartition的topic:
(1)Kafka sink
connector看到的是topic是topic和brokerName组合,这个组合是不可预测的,因为Rocketmq的brokerName是可变的,但是有些sink
connector的配置项目需要提供具体的topic,比如neo4j connector:
"neo4j.topic.cypher.my-topic": "MERGE (p:Person{name: event.name, surname:
event.surname}) MERGE (f:Family{name: event.surname}) MERGE
(p)-[:BELONGS_TO]->(f)"。
方案二:编码到TopicPartition的partition
给brokerName一个int的编号,然后编码到TopicPartition的partition前16bit里,基于大多数partition编号和broker数量都不会超过2^16=65536.
如何给brokerName一个int的编号
(1)提供一个配置项,用户指定:brokerName0:0,brokerName1:0
不足之处是当Rocketmq集群增加新节点的时候,需要重新提供新配置
(2)提供一个配置项,用户指定一个正则表达式,用户从brokerName提取编号,适用于brokerName带有编号的Rocketmq集群
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]