Send with confidence
Batching, idempotence, and transactions.
Dekaf is an Apache Kafka client for .NET. Unlike Confluent.Kafka, which wraps the native librdkafka library, it implements the Kafka wire protocol in C#, so there is nothing native to ship and no interop layer to cross.
dotnet add package DekafOne NuGet package with assets for .NET 10, .NET 8, and .NET Standard 2.0. Nothing native ships with it.
dotnet add package Dekaf
Build a producer from a broker address, then await the broker's acknowledgement. Fluent builders guide you to a valid configuration.
using Dekaf;
await using var producer = await Kafka
.CreateProducer<string, string>()
.WithBootstrapServers("localhost:9092")
.BuildAsync();
await producer.ProduceAsync(
"greetings", "hello", "Hello, Kafka!");
Join a consumer group and read records as an async stream with await foreach.
using Dekaf;
await using var consumer = await Kafka
.CreateConsumer<string, string>()
.WithBootstrapServers("localhost:9092")
.WithGroupId("greeting-reader")
.SubscribeTo("greetings")
.BuildAsync();
await foreach (var message in consumer.ConsumeAsync())
{
Console.WriteLine(message.Value);
}
Batching, idempotence, and transactions.
Consumer groups, rebalances, and offset control.
Serializers, compression, and the .NET services you already use.
Spans, pooled buffers, and ValueTask keep allocations off the hot path. Explore the benchmarks and the decisions behind the performance.