Epam.Kafka
2.4.166
Prefix Reserved
See the version list below for details.
dotnet add package Epam.Kafka --version 2.4.166
NuGet\Install-Package Epam.Kafka -Version 2.4.166
<PackageReference Include="Epam.Kafka" Version="2.4.166" />
<PackageVersion Include="Epam.Kafka" Version="2.4.166" />
<PackageReference Include="Epam.Kafka" />
paket add Epam.Kafka --version 2.4.166
#r "nuget: Epam.Kafka, 2.4.166"
#:package Epam.Kafka@2.4.166
#addin nuget:?package=Epam.Kafka&version=2.4.166
#tool nuget:?package=Epam.Kafka&version=2.4.166
Epam.Kafka
About
Epam.Kafka package provides AddKafka extension methods for IServiceCollection, IKafkaFactory interface and its default implementation. This provides the ability to set up named ConsumerConfig, IConsumer<TKey, TValue>, ProducerConfig, IProducer<TKey, TValue>, IClient, ISchemaRegistryClient configurations in a DI container and later retrieve them via an injected IKafkaFactory instance.
Key Features
- Fluently set up multiple
ConsumerConfig,IConsumer<TKey, TValue>,ProducerConfig,IProducer<TKey, TValue>,IClient,ISchemaRegistryClientconfigurations for applications that use DI viaAddKafkaextension method. KafkaFactorycachesIClient,ISchemaRegistryClientinstances per configuration name, which allows to reuse resources.- Shared clients with observable errors and statistics for creation of dependent admin client and dependent producer.
How to Use
Configuring IKafkaFactory using fluent API
KafkaBuilder kafkaBuilder = services.AddKafka();
kafkaBuilder.WithClusterConfig("Sandbox").Configure(options =>
{
options.ClientConfig.BootstrapServers = "localhost:9092";
options.ClientConfig.AllowAutoCreateTopics = true;
options.SchemaRegistryConfig.Url = "localhost:8081";
});
kafkaBuilder.WithConsumerConfig("Default").Configure(options =>
{
options.ConsumerConfig.GroupId = "consumer.epam-kafka-sample";
});
Using the configured IKafkaFactory
public class ConsumerSample : BackgroundService
{
private readonly IKafkaFactory _kafkaFactory;
public ConsumerSample(IKafkaFactory kafkaFactory)
{
this._kafkaFactory = kafkaFactory ?? throw new ArgumentNullException(nameof(kafkaFactory));
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
ConsumerConfig config = this._kafkaFactory.CreateConsumerConfig("Default");
using IConsumer<string, string> consumer = this._kafkaFactory.CreateConsumer<string, string>(config, "Sandbox");
consumer.Subscribe("epam-kafka-sample-topic-123");
while (!stoppingToken.IsCancellationRequested)
{
ConsumeResult<string, string>? result = consumer.Consume(stoppingToken);
Console.WriteLine($"Consumed {result.TopicPartitionOffset}");
}
}
}
Configuring IKafkaFactory using IConfiguration
By default IKafkaFactory configured from IConfiguration registered in IServiceCollection. This configuration can be extended or modified using fluent API. Sample of json config:
{
"Kafka": {
"Default": {
"Cluster": "Sandbox",
"Consumer": "Default",
"Producer": "Default"
},
"Clusters": {
"Sandbox": {
"bootstrap.servers": "localhost:9092",
"allow.auto.create.topics": true,
"schema.registry.url": "localhost:8081"
}
},
"Producers": {
"Default": {
"client.id": "<DomainName>@<MachineName>"
},
"Transactional": {
"client.id": "<DomainName>@<MachineName>"
"transactional.id": "producer.epam-kafka-sample"
}
},
"Consumers": {
"Default": {
"group.id": "consumer.epam-kafka-sample"
}
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Confluent.Kafka (>= 2.4.0)
- Confluent.SchemaRegistry (>= 2.4.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
-
.NETStandard 2.0
- Confluent.Kafka (>= 2.4.0)
- Confluent.SchemaRegistry (>= 2.4.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
-
net6.0
- Confluent.Kafka (>= 2.4.0)
- Confluent.SchemaRegistry (>= 2.4.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
-
net8.0
- Confluent.Kafka (>= 2.4.0)
- Confluent.SchemaRegistry (>= 2.4.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Epam.Kafka:
| Package | Downloads |
|---|---|
|
Epam.Kafka.PubSub
Framework for building pub/sub batch processing applications |
|
|
Epam.Kafka.HealthChecks
Health check extensions for [Epam.Kafka](https://www.nuget.org/packages/Epam.Kafka) package. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.5.260 | 2,732 | 6/23/2025 |
| 2.5.251-rc | 338 | 6/23/2025 |
| 2.5.246-rc | 278 | 2/25/2025 |
| 2.5.244 | 17,334 | 2/12/2025 |
| 2.5.241-rc | 303 | 2/12/2025 |
| 2.5.240-rc | 275 | 2/11/2025 |
| 2.5.239-rc | 298 | 2/10/2025 |
| 2.5.237-rc | 271 | 2/7/2025 |
| 2.5.236-rc | 293 | 2/7/2025 |
| 2.5.233 | 1,842 | 2/7/2025 |
| 2.5.229 | 328 | 2/6/2025 |
| 2.5.225-rc | 281 | 2/6/2025 |
| 2.5.224-rc | 263 | 2/6/2025 |
| 2.5.219-rc | 285 | 2/4/2025 |
| 2.5.218-rc | 310 | 2/4/2025 |
| 2.5.215-rc | 269 | 2/3/2025 |
| 2.5.214-rc | 286 | 2/3/2025 |
| 2.5.213-rc | 301 | 1/31/2025 |
| 2.5.210-rc | 323 | 1/30/2025 |
| 2.4.166 | 16,903 | 12/6/2024 |