KafkaStorm 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package KafkaStorm --version 1.0.0
NuGet\Install-Package KafkaStorm -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KafkaStorm" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KafkaStorm --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KafkaStorm, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KafkaStorm as a Cake Addin #addin nuget:?package=KafkaStorm&version=1.0.0 // Install KafkaStorm as a Cake Tool #tool nuget:?package=KafkaStorm&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KafkaStorm
Simple client for Kafka based on Confluent.Kafka (https://github.com/confluentinc/confluent-kafka-dotnet)
How to install
Using package manager:
Install-Package KafkaStorm -Version 1.0.0
How to use
.Net6 Example
Consuming
using Confluent.Kafka;
builder.Services.AddKafkaStorm(factory =>
{
factory.SetConsumerConfig(new ConsumerConfig()
{
BootstrapServers = "localhost:29092",
GroupId = "TestGroup"
});
factory.AddProducer(new ProducerConfig()
{
BootstrapServers = "localhost:29092",
});
factory.AddConsumer<HelloConsumer, HelloEvent>();
});
It's the same ConsumerConfig as Confluent.Kafka
Your consumer should look like this:
using KafkaStorm.Interfaces;
using Microsoft.Extensions.Logging;
public class HelloConsumer : IConsumer<HelloEvent>
{
private readonly ILogger<HelloConsumer> _logger;
public HelloConsumer(ILogger<HelloConsumer> logger)
{
_logger = logger;
}
public async Task Handle(HelloEvent @event, CancellationToken cancellationToken)
{
_logger.LogDebug("Message Received");
}}
Your event (message) can be any class like this:
public class HelloEvent
{
public HelloEvent(DateTime time)
{
Message = "Hello";
Time = time;
}
public string Message { get; }
public DateTime Time { get; }
}
Attention: if your class contains a property with Interface type it may cause exception while deserializing JSON
Producing
Just use IProducer like a service (initialize it with constructor):
using KafkaStorm.Interfaces;
private readonly IProducer _producer;
public TestService(IProducer producer)
{
_producer = producer;
}
And send message like this:
await _producer.ProduceAsync(new HelloEvent(DateTime.Now));
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Confluent.Kafka (>= 1.8.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.0)
- System.Text.Json (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
8.1.0 | 151 | 4/20/2024 | |
8.0.6 | 130 | 4/17/2024 | |
8.0.5 | 134 | 4/17/2024 | |
8.0.4 | 113 | 4/17/2024 | |
8.0.3 | 113 | 4/17/2024 | |
8.0.2 | 198 | 2/28/2024 | |
8.0.1 | 166 | 2/28/2024 | |
8.0.0 | 160 | 2/28/2024 | |
1.9.0 | 456 | 5/6/2023 | |
1.8.1 | 475 | 5/6/2023 | |
1.8.0 | 598 | 12/22/2022 | |
1.7.0 | 815 | 1/19/2022 | |
1.5.0 | 732 | 1/19/2022 | |
1.4.0 | 729 | 1/19/2022 | |
1.3.0 | 743 | 1/18/2022 | |
1.2.3 | 751 | 1/18/2022 | |
1.2.2 | 738 | 1/18/2022 | |
1.2.1 | 720 | 1/18/2022 | |
1.2.0 | 705 | 1/17/2022 | |
1.1.0 | 751 | 1/17/2022 | |
1.0.0 | 758 | 1/2/2022 |