https://github.com/kelindar/misakai-kafka
Misakai.Kafka is a high performance Apache Kafka client for C#.
https://github.com/kelindar/misakai-kafka
Last synced: about 1 month ago
JSON representation
Misakai.Kafka is a high performance Apache Kafka client for C#.
- Host: GitHub
- URL: https://github.com/kelindar/misakai-kafka
- Owner: kelindar
- License: apache-2.0
- Created: 2014-11-19T02:32:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-13T19:03:22.000Z (over 10 years ago)
- Last Synced: 2024-05-02T01:46:03.982Z (about 1 year ago)
- Language: C#
- Size: 270 KB
- Stars: 6
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Misakai.Kafka
=============High-Performance C# client for Apache Kafka. This client was designed not to support all possibile features, but to serve as a minimalistic and lightweight Kafka client for long-running producers/consumers. The code was based on James Roland's KafkaNet implementation, trimmed down and optimized significantly.
* Build Status: [](https://ci.appveyor.com/project/Kelindar/misakai-kafka)
* NuGet Package: [](https://www.nuget.org/packages/Misakai.Kafka/)Examples
-----------
##### Producer
```csharp
var options = new KafkaOptions(new Uri("http://kafka1:9092"), new Uri("http://kafka2:9092"))
{
Log = new ConsoleLog()
};
var router = new BrokerRouter(options);
var client = new Producer(router);Task.Run(() =>
{
var consumer = new Consumer(new ConsumerOptions("latencies", router));
foreach (var data in consumer.Consume())
{
// ... process each message
}
});while (true)
{
client.SendMessageAsync("latencies", new[] {
"message"
});
Thread.Sleep(1);
}client.Dispose();
router.Dispose();
```