<?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: Can I connect to Eventhub using Kafka API? Which is the preferred way? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/can-i-connect-to-eventhub-using-kafka-api-which-is-the-preferred/m-p/20792#M14080</link>
    <description>&lt;P&gt;Yes, it's possible to use Kafka API to connect to the eventhub. Eventhub supports the usage of Kafka API to stream the data from the Eventhub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference: &lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample program:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%python
&amp;nbsp;
eh_sasl = 'kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://myazure-train-eventhub.us.servicebus.windows.net/;SharedAccessKeyName=manage-policy;SharedAccessKey=xxxxxXXXXXXXXX/xxxxxxx;';
&amp;nbsp;
inputStream = spark.readStream \
.format("kafka") \
.option("subscribe", "dataabricks-stream-event") \
.option("kafka.bootstrap.servers", "azure-training-us.servicebus.windows.net:9093") \
.option("kafka.sasl.mechanism", "PLAIN") \
.option("startingOffsets","earliest") \
.option("kafka.security.protocol", "SASL_SSL") \
.option("kafka.sasl.jaas.config", eh_sasl) \
.option("kafka.request.timeout.ms", "60000") \
.option("kafka.session.timeout.ms", "30000") \
.option("failOnDataLoss", "false") \
.load()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 06:56:37 GMT</pubDate>
    <dc:creator>brickster_2018</dc:creator>
    <dc:date>2021-06-24T06:56:37Z</dc:date>
    <item>
      <title>Can I connect to Eventhub using Kafka API? Which is the preferred way?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-i-connect-to-eventhub-using-kafka-api-which-is-the-preferred/m-p/20791#M14079</link>
      <description />
      <pubDate>Thu, 24 Jun 2021 06:38:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-i-connect-to-eventhub-using-kafka-api-which-is-the-preferred/m-p/20791#M14079</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-24T06:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can I connect to Eventhub using Kafka API? Which is the preferred way?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-i-connect-to-eventhub-using-kafka-api-which-is-the-preferred/m-p/20792#M14080</link>
      <description>&lt;P&gt;Yes, it's possible to use Kafka API to connect to the eventhub. Eventhub supports the usage of Kafka API to stream the data from the Eventhub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference: &lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample program:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%python
&amp;nbsp;
eh_sasl = 'kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://myazure-train-eventhub.us.servicebus.windows.net/;SharedAccessKeyName=manage-policy;SharedAccessKey=xxxxxXXXXXXXXX/xxxxxxx;';
&amp;nbsp;
inputStream = spark.readStream \
.format("kafka") \
.option("subscribe", "dataabricks-stream-event") \
.option("kafka.bootstrap.servers", "azure-training-us.servicebus.windows.net:9093") \
.option("kafka.sasl.mechanism", "PLAIN") \
.option("startingOffsets","earliest") \
.option("kafka.security.protocol", "SASL_SSL") \
.option("kafka.sasl.jaas.config", eh_sasl) \
.option("kafka.request.timeout.ms", "60000") \
.option("kafka.session.timeout.ms", "30000") \
.option("failOnDataLoss", "false") \
.load()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 06:56:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-i-connect-to-eventhub-using-kafka-api-which-is-the-preferred/m-p/20792#M14080</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-24T06:56:37Z</dc:date>
    </item>
  </channel>
</rss>

