You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/02/25 00:49:36 UTC

[GitHub] [kafka] ecararus opened a new pull request #11803: KAFKA-13691: Rename target topic to custom name

ecararus opened a new pull request #11803:
URL: https://github.com/apache/kafka/pull/11803


   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [*] Verify design and implementation 
   - [*] Verify test coverage and CI build status
   - [*] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] mimaison commented on pull request #11803: KAFKA-13691: Rename target topic to custom name

Posted by GitBox <gi...@apache.org>.
mimaison commented on pull request #11803:
URL: https://github.com/apache/kafka/pull/11803#issuecomment-1055584957


   Hi @ecararus, thanks for the PR.
   
   As this is changing public APIs, this type of change requires following the KIP process: https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals


-- 
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: jira-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] ecararus edited a comment on pull request #11803: KAFKA-13691: Rename target topic to custom name

Posted by GitBox <gi...@apache.org>.
ecararus edited a comment on pull request #11803:
URL: https://github.com/apache/kafka/pull/11803#issuecomment-1050407569


   Related to ISSUE : [KAFKA-13691](https://issues.apache.org/jira/browse/KAFKA-13691)
   
   When I use mirrormaker it replicates the topics with different name, name of target is built based on
   
   sourceClusterAlias + separator + topic  
    
   
   implementation is [here](https://github.com/apache/kafka/blob/trunk/connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/DefaultReplicationPolicy.java#L49).
   
   Proposed improvement consist in:
   Adding new config property key: target.replication.policy.topic_map
   
   E.I. 
   
   source-> target.replication.policy.class= org.apache.kafka.connect.mirror.RenameTopicReplicationPolicy
   
   source->target.replication.policy.separator = .
   source->target.replication.policy.topic_map= SOURCER_TOPIC_A,DESTINATION_TOPIC_A; SOURCER_TOPIC_B,DESTINATION_TOPIC_B; 
   and add new RenameTopicReplicationPolicy which will be responsible to:
   1. override configure method load target.replication.policy.topic_map into a Map where Key is source topic name and value is target topic name 
   
    
   
    2. override formatRemoteTopic so the target topic name will be loaded based on config
   
   @Override
   public String formatRemoteTopic(String sourceClusterAlias, String topic) {
       String targetTopic = topicMap.containsKey(topic) ?  topicMap.get(topic) : topic ;
       return super.formatRemoteTopic(sourceClusterAlias,targetTopic);
   }


-- 
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: jira-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] ecararus commented on pull request #11803: KAFKA-13691: Rename target topic to custom name

Posted by GitBox <gi...@apache.org>.
ecararus commented on pull request #11803:
URL: https://github.com/apache/kafka/pull/11803#issuecomment-1050407569


   When I use mirrormaker it replicates the topics with different name, name of target is built based on
   
   sourceClusterAlias + separator + topic  
    
   
   implementation is [here](https://github.com/apache/kafka/blob/trunk/connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/DefaultReplicationPolicy.java#L49).
   
   Proposed improvement consist in:
   Adding new config property key: target.replication.policy.topic_map
   
   E.I. 
   
   source-> target.replication.policy.class= org.apache.kafka.connect.mirror.RenameTopicReplicationPolicy
   
   source->target.replication.policy.separator = .
   source->target.replication.policy.topic_map= SOURCER_TOPIC_A,DESTINATION_TOPIC_A; SOURCER_TOPIC_B,DESTINATION_TOPIC_B; 
   and add new RenameTopicReplicationPolicy which will be responsible to:
   1. override configure method load target.replication.policy.topic_map into a Map where Key is source topic name and value is target topic name 
   
    
   
    2. override formatRemoteTopic so the target topic name will be loaded based on config
   
   @Override
   public String formatRemoteTopic(String sourceClusterAlias, String topic) {
       String targetTopic = topicMap.containsKey(topic) ?  topicMap.get(topic) : topic ;
       return super.formatRemoteTopic(sourceClusterAlias,targetTopic);
   }


-- 
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: jira-unsubscribe@kafka.apache.org

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