<?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 Re: Accessing confluent schema registry from databricks with scala fails with 401 (just for scala, not python, just in databricks) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13158#M7872</link>
    <description>&lt;P&gt;Hi @Alon Nisser​&amp;nbsp;- My name is Piper and I'm one of the community moderators. Welcome and thanks for your question. Let's give this a bit longer to see what the community says. &lt;/P&gt;</description>
    <pubDate>Sun, 17 Oct 2021 18:57:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-17T18:57:44Z</dc:date>
    <item>
      <title>Accessing confluent schema registry from databricks with scala fails with 401 (just for scala, not python, just in databricks)</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13157#M7871</link>
      <description>&lt;P&gt;Nore, I've tested with the same connection variable:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;locally with scala - works (via the same prod schema registry)&lt;/LI&gt;&lt;LI&gt;in the cluster with python - works&lt;/LI&gt;&lt;LI&gt;in the cluster with scala - fails with 401 auth error&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE&gt;def setupSchemaRegistry(schemaRegistryUrl: String, confluentRegistryApiKey: String, confluentRegistrySecret: String): CachedSchemaRegistryClient = {
&amp;nbsp;
   val props = Map(
      "basic.auth.credentials.source" -&amp;gt; "USER_INFO",
      "basic.auth.user.info" -&amp;gt; s"$confluentRegistryApiKey:$confluentRegistrySecret",
      "schema.registry.basic.auth.credentials.source" -&amp;gt; "USER_INFO", //tried both this version just to be sure
      "schema.registry.url" -&amp;gt; schemaRegistryUrl,
      "schema.registry.basic.auth.user.info" -&amp;gt; s"$confluentRegistryApiKey:$confluentRegistrySecret"
    ).asJava  
//   val restService = new RestService(schemaRegistryUrl)
    
&amp;nbsp;
    // The format of the schema registry credentials below is confluentRegistryApiKey:confluentRegistrySecret
    println(s"schema registry info $schemaRegistryUrl $confluentRegistryApiKey $confluentRegistrySecret")
    // also tried the version where I pass the restService inside instead, etc
    new CachedSchemaRegistryClient(schemaRegistryUrl, 100, props)
}
val schemaRegistry = setupSchemaRegistry(schemaRegistryUrl, confluentRegistryApiKey, confluentRegistrySecret)
val res = schemaRegistry.getSchemaById(number) //gets 401
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;databricks runtime : 9.1&lt;/P&gt;&lt;P&gt;confluent client 6.2.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why would it fail just in scala, just from databricks cluster? I can't explain that! &lt;/P&gt;&lt;P&gt;I'll be glad for any help&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 16:36:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13157#M7871</guid>
      <dc:creator>alonisser</dc:creator>
      <dc:date>2021-10-16T16:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing confluent schema registry from databricks with scala fails with 401 (just for scala, not python, just in databricks)</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13158#M7872</link>
      <description>&lt;P&gt;Hi @Alon Nisser​&amp;nbsp;- My name is Piper and I'm one of the community moderators. Welcome and thanks for your question. Let's give this a bit longer to see what the community says. &lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 18:57:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13158#M7872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-17T18:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing confluent schema registry from databricks with scala fails with 401 (just for scala, not python, just in databricks)</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13159#M7873</link>
      <description>&lt;P&gt;Found the issue: it's the uber package mangling some dependency resolving, which I fixed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another issue, is that currently you can't use 6.* branch of confluent schema registry client in databricks, because the avro version is different then the one supported in spark 3.1&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 11:03:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-confluent-schema-registry-from-databricks-with-scala/m-p/13159#M7873</guid>
      <dc:creator>alonisser</dc:creator>
      <dc:date>2021-10-18T11:03:31Z</dc:date>
    </item>
  </channel>
</rss>

