0

I have a use-case where I need to convert a SourceRecord to a GenericRecord. Can someone help me how to do that?

Basically, I'm writing a custom Kafka Producer and embed that in the Connect runtime code. When the producer.send() is called, the SourceRecord gets converted to a ProducerRecord<byte[],byte[]> type. Now, from this, how do I get a GenericRecord so I can perform my custom tasks?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
guru
  • 409
  • 4
  • 21

1 Answers1

0

Look at Confluent AvroData class in the schema registry repo. There is some method in there to/from Connect Data Schema/Struct classes (which are embedded in a SourceRecord's key/value)

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245