Skip to content

Async wrapper for Confluent's .NET Kafka consumer client.

License

Notifications You must be signed in to change notification settings

moritzrinow/kafka-net-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-net-async

Async wrapper for Confluent's .NET Kafka consumer client.

Installation

Nuget package: https://www.nuget.org/packages/Kafka.Async

Targets:

  • netstandard2.1

Example

using Kafka.Async;

IConsumer<string, string> consumer = myConsumerInstance;

using IAsyncConsumer<string, string> asyncConsumer = consumer.CreateAsyncConsumer();

// Consume message asynchronously
ConsumeResult<string, string> message = await asyncConsumer.ConsumeAsync(cancellationToken).ConfigureAwait(false);

// Consume messages continuously
await foreach (ConsumeResult<string, string> result in asyncConsumer.AsAsyncEnumerable(stoppingToken).ConfigureAwait(false))
{
  // Handle message
}

About

Async wrapper for Confluent's .NET Kafka consumer client.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages