Skip to content

Connecting to a Kafka-enabled Azure Event Hubs using Confluent's .NET Client

License

Notifications You must be signed in to change notification settings

syedhassaanahmed/hello-kafka-on-eventhubs-cs

Repository files navigation

hello-kafka-on-eventhubs-cs

This repo demonstrates how to connect to a Kafka-enabled Azure Event Hubs using Confluent's .NET Client.

Caveat

This doc 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, set its build setting to "Always copy to output directory" and reference it in the ssl.ca.location.

Reference

ConfluentCloud's C# example

About

Connecting to a Kafka-enabled Azure Event Hubs using Confluent's .NET Client

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages