sanjeev0915
sanjeev0915

Reputation: 11

Concatenate value of two fields before publishing to kafka topic using Connect SMT

Is ReplaceField transform used only to replace or mask the field name Or can I change the value of the field as well using some expression , with static values ?

My need is to concatenate value of two fields before publishing to kafka topic.

Upvotes: 0

Views: 1899

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191733

org.apache.kafka.connect.transforms.InsertField is used to add static values or topic metadata (topic name, partition, timestamp, offset, etc), but not concatenate, or use expressions.

org.apache.kafka.connect.transforms.ReplaceField is used to rename/filter existing fields, not add new ones.


That being said, you're going to have to create your own Transformation subclass that can merge a list of fields.

Or publish the existing "raw" data then use Kafka Streams or KSQL to create the "enriched" topic.

Upvotes: 2

Related Questions