Skip to content

thetechi/misakai-kafka

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: Build status
  • NuGet Package: Misakai.Kafka

Examples

Producer
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();

About

Misakai.Kafka is a high performance Apache Kafka client for C#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.7%
  • PowerShell 0.3%