hello-kafka-on-eventhubs-cs

所属分类:中间件编程
开发工具:C#
文件大小:0KB
下载次数:0
上传日期:2018-10-26 22:17:57
上 传 者sh-1993
说明:  使用Confluent的.NET客户端连接到支持Kafka的Azure事件中心
(Connecting to a Kafka -enabled Azure Event Hubs using Confluent s .NET Client)

文件列表:
HelloKafkaOnEventHub.csproj (401, 2018-10-26)
HelloKafkaOnEventHub.sln (1113, 2018-10-26)
LICENSE (1075, 2018-10-26)
Program.cs (1699, 2018-10-26)
cacert.pem (215556, 2018-10-26)

# hello-kafka-on-eventhubs-cs This repo demonstrates how to connect to a [Kafka-enabled Azure Event Hubs](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview) using [Confluent's .NET Client](https://github.com/confluentinc/confluent-kafka-dotnet). ## Caveat [This doc](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs#send-and-receive-messages-with-kafka-in-event-hubs) describes how to provide auth config for connecting a Java-based Kafka Producer/Consumer. However the setting `sasl.jaas.config` won't work with Confluent's .NET Client and will throw an exception: ``` Unhandled Exception: System.ArgumentException: Java JAAS configuration is not supported, see https://github.com/edenhill/librdkafka/wiki/Using-SASL-with-librdkafka for more information. ``` ## Solution Instead of using `sasl.jaas.config`, use `sasl.username` and `sasl.password`. Furthermore on Windows, default trusted root CA certs are stored in Windows Registry. They're not automatically discovered by Confluent client. You'll need to obtain these from somewhere else, hence I've used the `cacert.pem` file distributed with [curl](https://curl.haxx.se/ca/cacert.pem), set its build setting to "Always copy to output directory" and reference it in the `ssl.ca.location`. ## Reference [ConfluentCloud's C# example](https://github.com/confluentinc/confluent-kafka-dotnet/blob/17004b179df7fcde38e12062391b60c9a37d4a41/examples/ConfluentCloud/Program.cs#L51)

近期下载者

相关文件


收藏者