Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 2.23 KB

README.md

File metadata and controls

56 lines (36 loc) · 2.23 KB

Sample C/C++ consumer and producer implementation for Azure EventHub with Kafka surface

Since there I wasn't able to find any exisiting libraries for connecting to Azure EventHub from C/C++ using native EventHub Kafka surface capabilities and using librdkafka to achive it.

Exisiting EventHub AMQP capacities could be used to reach the same level using either azure-uamqp-c or Qpid Proton

Azure EventHub setup

https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-create

Create EventHub Namespace with minimum Standard tier since Kafka Surface is not avaiaible in Basic tier.

EventHub Namespace

After creating EventHub within EventHub Namespace for the configuration we will need Hostname and Shared access policies Connection String.

EventHub

Build and run

Copy getting-started.ini.sample file to getting-started.ini and update fields with XXXXXX based on the information from EventHub configuration.

Examples assumes the Event Hub name (topic name) is purchases.

Consumer

docker build -f Dockerfile.consumer . azure-eventhub-kafka-c-consumer:latest
docker run azure-eventhub-kafka-c-consumer:latest

Producer

docker build -f Dockerfile.producer . azure-eventhub-kafka-c-producer:latest
docker run azure-eventhub-kafka-c-producer:latest

Animation

Materials and references