是的,這是可以使用API連接到eventhub卡夫卡。Eventhub支持卡夫卡API的使用從Eventhub流數據
參考:
https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview
示例程序:
% python eh_sasl = ' kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule需要用戶名= " $ ConnectionString "密碼= "端點=某人:/ /myazure-train-eventhub.us.servicebus.windows.net/; SharedAccessKeyName =管理政策;SharedAccessKey = xxxxxXXXXXXXXX / xxxxxxx; ';inputStream =火花。readStream \ .format(“卡夫卡”)\ .option(“訂閱”、“dataabricks-stream-event”) \ .option (“kafka.bootstrap。服務器”、“azure-training-us.servicebus.windows.net: 9093”) \ .option (“kafka.sasl。機製”、“普通”)\ .option (“startingOffsets”、“最早”)\ .option (“kafka.security。協議”、“SASL_SSL”) \ .option (“kafka.sasl.jaas。配置”,eh_sasl) \ .option (“kafka.request.timeout。女士”,“60000”)\ .option (“kafka.session.timeout。女士”,“30000”)\ .option (“failOnDataLoss”,“假”)\ .load ()
是的,這是可以使用API連接到eventhub卡夫卡。Eventhub支持卡夫卡API的使用從Eventhub流數據
參考:
https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview
示例程序:
% python eh_sasl = ' kafkashaded.org.apache.kafka.common.security.plain.PlainLoginModule需要用戶名= " $ ConnectionString "密碼= "端點=某人:/ /myazure-train-eventhub.us.servicebus.windows.net/; SharedAccessKeyName =管理政策;SharedAccessKey = xxxxxXXXXXXXXX / xxxxxxx; ';inputStream =火花。readStream \ .format(“卡夫卡”)\ .option(“訂閱”、“dataabricks-stream-event”) \ .option (“kafka.bootstrap。服務器”、“azure-training-us.servicebus.windows.net: 9093”) \ .option (“kafka.sasl。機製”、“普通”)\ .option (“startingOffsets”、“最早”)\ .option (“kafka.security。協議”、“SASL_SSL”) \ .option (“kafka.sasl.jaas。配置”,eh_sasl) \ .option (“kafka.request.timeout。女士”,“60000”)\ .option (“kafka.session.timeout。女士”,“30000”)\ .option (“failOnDataLoss”,“假”)\ .load ()