- Notifications
You must be signed in to change notification settings - Fork73
ah-/rdkafka-dotnet
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project has moved tohttps://github.com/confluentinc/confluent-kafka-dotnet and is now being maintained by Confluent
Please update toConfluent.Kafka.
Copyright (c) 2015-2016,Andreas Heider
rdkafka-dotnet is a C# client forApache Kafka based onlibrdkafka.
rdkafka-dotnet is licensed under the 2-clause BSD license.
Just reference theRdKafka NuGet package
using(Producerproducer=newProducer("127.0.0.1:9092"))using(Topictopic=producer.Topic("testtopic")){byte[]data=Encoding.UTF8.GetBytes("Hello RdKafka");DeliveryReportdeliveryReport=awaittopic.Produce(data);Console.WriteLine($"Produced to Partition:{deliveryReport.Partition}, Offset:{deliveryReport.Offset}");}
varconfig=newConfig(){GroupId="example-csharp-consumer"};using(varconsumer=newEventConsumer(config,"127.0.0.1:9092")){consumer.OnMessage+=(obj,msg)=>{stringtext=Encoding.UTF8.GetString(msg.Payload,0,msg.Payload.Length);Console.WriteLine($"Topic:{msg.Topic} Partition:{msg.Partition} Offset:{msg.Offset}{text}");};consumer.Subscribe(new[]{"testtopic"});consumer.Start();Console.WriteLine("Started consumer, press enter to stop consuming");Console.ReadLine();}
Seeexamples/
Read the API Documentation here
Read the FAQ for answers to common questions
Requires .NET 4.5 or later. Tested with .NET Core on Linux, OS X and Windows, and classic .NET 4.5 on Windows.
About
C# Apache Kafka client
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.
