Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to avro encode a kafka message key

Highlighted

How to avro encode a kafka message key

New Contributor

I'm trying to produce messages to a kafka topic using the PublishKafkaRecord_0_11 processor. We are also using a confluent schema registry with a schema for both the value and the key. The configurations are attached.

The issue is that our scala consumer isn't able to deserialize the messages due to the message keys not being properly avro encoded with the schema registry. The message values appear to be serialized properly.

Is there an easy way to use the schema registry to encode the message keys as an avro record?

76645-avrorecordsetwriter-config.png

76644-jsontreereader-config.png

76643-producer-config.png

1 REPLY 1

Re: How to avro encode a kafka message key

Hi @John King!
I'm not a confluent platform specialist, but how did you set the schema registry?
Was using this config?
https://github.com/confluentinc/schema-registry/blob/master/config/connect-avro-standalone.propertie...
or
https://github.com/confluentinc/schema-registry/blob/master/config/connect-avro-distributed.properti...


Once I had a problem by setting the wrong internal serializers + schema disabled in my schema registry.

Hope this helps! :)