Search code examples
apache-kafka-connectsmtdebeziumcdc

Debezium SMT transform reroute key field setting is not working


I am trying to use the configurations below. Rerouting to a topic works well. However, the field "tableType" configured as a key field is not added to the schema.

I also tried to have only "transforms.Reroute.key.enforce.uniqueness=true" to get the default table name but it doesn't work either.

transforms="Reroute"
transforms.Reroute.type="io.debezium.transforms.ByLogicalTableRouter"
transforms.Reroute.topic.regex="(.*)\\.([A-Z]{3,5}+)\\.(.*)$"
transforms.Reroute.topic.replacement="$1.tables.$3"
transforms.Reroute.key.field.name="tableType"
transforms.Reroute.key.field.regex="(.*)\\.([A-Z]{3,5}+)\\.(.*)$"
transforms.Reroute.key.field.replacement="$2"
transforms.Reroute.key.enforce.uniqueness=true

key.converter="io.confluent.connect.avro.AvroConverter"
value.converter="io.confluent.connect.avro.AvroConverter"
...

https://issues.redhat.com/browse/DBZ-3871


Solution

  • Apparently, it is working, but it saves in the key - not in the value, which caused the confusion.