<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Unable to get correct confluent schema registry schema id for kafka key in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-get-correct-confluent-schema-registry-schema-id/m-p/393054#M248323</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have a nifi kafka consumer (ConsumeKafka_2_6) where the kafka message body (value/flow file content) and message key (kafka.key in flow file attributes) both are avro serialized as per the Confluent kafka way of&amp;nbsp;&amp;nbsp;serializing.&lt;/P&gt;&lt;P&gt;When we use "ConvertRecord + AvroReader CS +&amp;nbsp;&lt;SPAN&gt;ConfluentSchemaRegistry CS"&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;to convert message body (value/flow file content) , it works fine as it is deserilising the magic byte and schema id to the correct value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But we are trying below to deserilise kafka.key as well the same as value.&lt;BR /&gt;&lt;BR /&gt;Bringing the FF attribute kafka key to content (using ReplaceText processor with ${kafka.key}) and use "onvert Record + Avro Reader +&amp;nbsp;&lt;SPAN&gt;ConfluentSchemaRegistry&lt;/SPAN&gt;" to deserialize, in this case nifi is resulting in a wrong schema id - 3567 instead of the correct schema id &lt;SPAN&gt;3545.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is it happening because when Nifi reads kafka.key (originally byte array) and pushes to downstream in FF as FF attribute and which is string?&lt;/P&gt;&lt;P&gt;Is there any other way I can fix this or any other right approach?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/36106"&gt;@bbende&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/77823"&gt;@mattw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mahendra&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 12:34:18 GMT</pubDate>
    <dc:creator>hegdemahendra</dc:creator>
    <dc:date>2024-09-04T12:34:18Z</dc:date>
    <item>
      <title>Unable to get correct confluent schema registry schema id for kafka key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-get-correct-confluent-schema-registry-schema-id/m-p/393054#M248323</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have a nifi kafka consumer (ConsumeKafka_2_6) where the kafka message body (value/flow file content) and message key (kafka.key in flow file attributes) both are avro serialized as per the Confluent kafka way of&amp;nbsp;&amp;nbsp;serializing.&lt;/P&gt;&lt;P&gt;When we use "ConvertRecord + AvroReader CS +&amp;nbsp;&lt;SPAN&gt;ConfluentSchemaRegistry CS"&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;to convert message body (value/flow file content) , it works fine as it is deserilising the magic byte and schema id to the correct value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But we are trying below to deserilise kafka.key as well the same as value.&lt;BR /&gt;&lt;BR /&gt;Bringing the FF attribute kafka key to content (using ReplaceText processor with ${kafka.key}) and use "onvert Record + Avro Reader +&amp;nbsp;&lt;SPAN&gt;ConfluentSchemaRegistry&lt;/SPAN&gt;" to deserialize, in this case nifi is resulting in a wrong schema id - 3567 instead of the correct schema id &lt;SPAN&gt;3545.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is it happening because when Nifi reads kafka.key (originally byte array) and pushes to downstream in FF as FF attribute and which is string?&lt;/P&gt;&lt;P&gt;Is there any other way I can fix this or any other right approach?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/36106"&gt;@bbende&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/77823"&gt;@mattw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mahendra&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 12:34:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-get-correct-confluent-schema-registry-schema-id/m-p/393054#M248323</guid>
      <dc:creator>hegdemahendra</dc:creator>
      <dc:date>2024-09-04T12:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get correct confluent schema registry schema id for kafka key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-get-correct-confluent-schema-registry-schema-id/m-p/393083#M248332</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/11191"&gt;@araujo&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/36106"&gt;@bbende&lt;/a&gt;&amp;nbsp;&lt;A href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454" target="_blank"&gt;@MattWho&lt;/A&gt;&amp;nbsp;- do you have any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 05:18:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-get-correct-confluent-schema-registry-schema-id/m-p/393083#M248332</guid>
      <dc:creator>hegdemahendra</dc:creator>
      <dc:date>2024-09-05T05:18:03Z</dc:date>
    </item>
  </channel>
</rss>

