Yottadem.Kafka.Producer.Sdk
1.1.1
dotnet add package Yottadem.Kafka.Producer.Sdk --version 1.1.1
NuGet\Install-Package Yottadem.Kafka.Producer.Sdk -Version 1.1.1
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="Yottadem.Kafka.Producer.Sdk" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yottadem.Kafka.Producer.Sdk" Version="1.1.1" />
<PackageReference Include="Yottadem.Kafka.Producer.Sdk" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Yottadem.Kafka.Producer.Sdk --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yottadem.Kafka.Producer.Sdk, 1.1.1"
#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.
#:package Yottadem.Kafka.Producer.Sdk@1.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Yottadem.Kafka.Producer.Sdk&version=1.1.1
#tool nuget:?package=Yottadem.Kafka.Producer.Sdk&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Yottadem Kafka Producer SDK
A lightweight and scalable Kafka Producer SDK for .NET applications developed by Yottadem Tech Solutions.
Author
Yottadem Tech Solutions
Company
Yottadem Tech Solutions
Features
- Simple Kafka producer setup
- Multi-host Kafka configuration support
- Dependency Injection support
- Async message production
- Supports .NET 6 and .NET 8
- Built with Akka Streams Kafka
Installation
Install the package using NuGet Package Manager:
Install-Package Yottadem.Kafka.Producer.Sdk
Or using the .NET CLI:
dotnet add package Yottadem.Kafka.Producer.Sdk
Configuration
Add the following configuration to your appsettings.json file:
{
"KafkaProducerConfig": {
"Hosts": [
{
"BootstrapServers": "localhost:9092",
"Alias": "ecommerce-kafka",
"SecurityProtocol": "SASL_SSL",
"SaslMechanism": "PLAIN",
"SaslUsername": "API-Key",
"SaslPassword": "API-Secret"
},
{
"BootstrapServers": "localhost:9092",
"Alias": "general-kafka-2",
"SecurityProtocol": "SASL_SSL",
"SaslMechanism": "PLAIN",
"SaslUsername": "API-Key",
"SaslPassword": "API-Secret"
}
]
}
}
Service Registration
Register the SDK in Program.cs or Startup.cs:
services.AddYottademKafkaProducerSdk(config =>
Configuration.GetSection(nameof(KafkaProducerConfig)).Bind(config));
Usage
Inject IKafkaProducerFactory into your service and create a Kafka producer instance.
public class ProduceToKafkaService
{
private readonly IKafkaProducer _producer;
public ProduceToKafkaService(IKafkaProducerFactory producerFactory)
{
_producer = producerFactory.CreateKafkaProducer("general-kafka");
}
public async Task ProduceToKafka(object data)
{
await _producer.ProduceAsync("test.topic", data);
}
}
Supported Frameworks
- .NET 8
License
This project is licensed under the MIT License.
Maintained By
Yottadem Tech Solutions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Akka.Streams.Kafka (>= 1.5.40.1)
- Confluent.Kafka.Extensions (>= 1.0.0)
- Confluent.Kafka.Extensions.Diagnostics (>= 0.5.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- OpenTelemetry.Api (>= 1.15.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.