1

I have not found any documentation or examples that indicate how to pass the settings of the Schema Registry and the Avro serializer from Confluent to Spark Structured Streaming (databricks).

This settings:

// Schema Registry specific settings basic.auth.credentials.source=USER_INFO schema.registry.basic.auth.user.info=: schema.registry.url=https://psrc-1kk8p.westeurope.azure.confluent.cloud

// Enable Avro serializer with Schema Registry key.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer

This is what my current code looks like:

val inputStream = spark.readStream
    .format("kafka")
    .option("kafka.ssl.endpoint.identification.algorithm", "https")
    .option("kafka.sasl.mechanism", "PLAIN")
    .option("kafka.request.timeout.ms", "20000")
    .option("kafka.bootstrap.servers", brokers)
    .option("kafka.retry.backoff.ms", "500")
    .option("kafka.sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username=<my_user_name> password=<my_password>;")
    .option("kafka.security.protocol", "SASL_SSL")
    .option("subscribe", inputTopic)
    .option("startingOffsets", "latest")
    .load()

I hope I can get spark to connect and authenticate with the settings.

xav
  • 391
  • 2
  • 10

0 Answers0