Need debezium connector to send mysql table composite key as kafka key and complete record as avro

240 views
Skip to first unread message

Ramesh Sharma

unread,
Jun 19, 2018, 7:13:22 AM6/19/18
to debezium
hi, I am working with debezium in development and using debezium connector to stream changes from mysql table to kafka topic. I need some help. I have a table t with columns c1, c2, c3, c4. For my usecase, need is to send c1+c2 String value as kafka key and whole record as avro record. Can anyone help me implement this using debezium connector ?

Gunnar Morling

unread,
Jun 20, 2018, 10:38:30 AM6/20/18
to debezium
Hey,

By default the message's key will be made up of the PK column(s) of the captured table. You might implement an SMT (single message transform) for altering the key created by default into the format you need. The serialization format (JSON, Avro etc.) is a separate concern, please see http://debezium.io/docs/configuration/avro/ for details on using Avro.

Hth,

--Gunnar
Reply all
Reply to author
Forward
0 new messages