carlos-verdes opened a new pull request #9176:
URL: https://github.com/apache/kafka/pull/9176


   ### Context 
   I need to create topics on the fly from database table names (cdc) and I'm 
replacing all `_` with `-`.
   With current RegexRouter I can't do this in one call (actually if I don't 
know the number of `_` I don't know how many times I need to call the 
transformer).
   
   That's the reason why I implemented a new flag to allow replaceAll on 
RegexRouter.
   
   ### Change applied
   I added a new flag `replaceAll` of type `Boolean` with default value `false` 
which allows to apply a regex replacement in all occurencces of the topic name.
   I updated the description of the transformer and added 2 tests to cover 
previous and new behaviour.
   
   ### Testing strategy (Unit test)
   I created a new topic name with two `_` symbols (`sample_table_name`).
   I called a regex with current implementation expecting only the first `_` to 
be substituted.
   I called a regex with new flag expecting all `_` to be replaced with `-`.
   
   ### 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.

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


Reply via email to