<?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>topic How to write data to Confluent Kafka with SchemaRegistry format on sparkstructured? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-write-data-to-confluent-kafka-with-schemaregistry-format/m-p/73080#M34638</link>
    <description>&lt;P&gt;Hi There!&lt;BR /&gt;I am to trying write a batch data to kafka topic with schema registry in databricks using pyspark, i serialize the data with pyspark to_avro function and write it to the topic, but the consumers can’t read the schema id. If they do not separate the schema_id first 5 bytes they can read the data as well.&lt;BR /&gt;I read the avro schema from .avsc file downloaded in confluent, and it’s version is ok.&lt;/P&gt;&lt;P&gt;This is my script:&lt;/P&gt;&lt;P&gt;df.select(to_avro(carrossel_schema, schema_str)).alias("value") \&lt;BR /&gt;.write \&lt;BR /&gt;.format('kafka') \&lt;BR /&gt;.option("kafka.bootstrap.servers", confluent_server) \&lt;BR /&gt;.option("topic", topico) \&lt;BR /&gt;.option("kafka.security.protocol", "SASL_SSL") \&lt;BR /&gt;.option(&lt;BR /&gt;"kafka.sasl.jaas.config",&lt;BR /&gt;f"kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule required username='{confluent_user}' password='{confluent_pass}';"&lt;BR /&gt;) \&lt;BR /&gt;.option("kafka.ssl.endpoint.identification.algorithm", "https") \&lt;BR /&gt;.option("kafka.sasl.mechanism", "PLAIN") \&lt;BR /&gt;.save()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return df&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 20:01:41 GMT</pubDate>
    <dc:creator>GCosta</dc:creator>
    <dc:date>2024-06-12T20:01:41Z</dc:date>
    <item>
      <title>How to write data to Confluent Kafka with SchemaRegistry format on sparkstructured?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-write-data-to-confluent-kafka-with-schemaregistry-format/m-p/73080#M34638</link>
      <description>&lt;P&gt;Hi There!&lt;BR /&gt;I am to trying write a batch data to kafka topic with schema registry in databricks using pyspark, i serialize the data with pyspark to_avro function and write it to the topic, but the consumers can’t read the schema id. If they do not separate the schema_id first 5 bytes they can read the data as well.&lt;BR /&gt;I read the avro schema from .avsc file downloaded in confluent, and it’s version is ok.&lt;/P&gt;&lt;P&gt;This is my script:&lt;/P&gt;&lt;P&gt;df.select(to_avro(carrossel_schema, schema_str)).alias("value") \&lt;BR /&gt;.write \&lt;BR /&gt;.format('kafka') \&lt;BR /&gt;.option("kafka.bootstrap.servers", confluent_server) \&lt;BR /&gt;.option("topic", topico) \&lt;BR /&gt;.option("kafka.security.protocol", "SASL_SSL") \&lt;BR /&gt;.option(&lt;BR /&gt;"kafka.sasl.jaas.config",&lt;BR /&gt;f"kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule required username='{confluent_user}' password='{confluent_pass}';"&lt;BR /&gt;) \&lt;BR /&gt;.option("kafka.ssl.endpoint.identification.algorithm", "https") \&lt;BR /&gt;.option("kafka.sasl.mechanism", "PLAIN") \&lt;BR /&gt;.save()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return df&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 20:01:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-write-data-to-confluent-kafka-with-schemaregistry-format/m-p/73080#M34638</guid>
      <dc:creator>GCosta</dc:creator>
      <dc:date>2024-06-12T20:01:41Z</dc:date>
    </item>
  </channel>
</rss>

