GitHunt
RO

Simple client for publishing and consuming Kafka messages

Jackdaw

Docs NuGet Discussions License

A high-performance Kafka client written in managed C#.

Jackdaw aims to be API-compatible with the official Confluent Kafka library, so that any migration to Jackdaw should be seamless, even down to the config settings used.

Jackdaw aims to be:

  • ๐Ÿƒ High-performance with low memory usage
  • ๐Ÿ”ง Extensible for use cases such as AWS IAM authentication
  • ๐Ÿค Cross-platform using fully managed code
  • โœ… API-compliant to the official Confluent Kafka library

Usage

Install the package from NuGet with dotnet add package Jackdaw.

Create your producer and/or consumer with the correct settings, and publish/subscribe to the topics you need, as below:

var producerConfig = new ProducerConfig
{
    BootstrapServers = "localhost:9092"
};

var consumerConfig = new ConsumerConfig
{
    BootstrapServers = "localhost:9092",
    GroupId = "my-group"
};

using var producer = new ProducerBuilder<string, string>(producerConfig)
    .Build();

using var consumer = new ConsumerBuilder<string, string>(consumerConfig)
    .Build();

producer.Produce("my-topic", new Message<string, string>
{
    Key = "key", Value = "value"
});

consumer.Subscribe("my-topic");

var result = consumer.Consume();

Documentation

See the wiki for examples and help using Jackdaw.

Get in touch

Discuss with us on Discussions, or raise an issue.

Discussions

Contributing

Please read CONTRIBUTING.md for details on how to contribute to this project.

Acknowledgements

With much โค๏ธ to the Confluent Kafka library.

License

Jackdaw is released under the Apache 2.0 License

Contributors

Apache License 2.0
Created April 2, 2023
Updated December 10, 2024