KafkaProducerHost 1.0.0

dotnet add package KafkaProducerHost --version 1.0.0
                    
NuGet\Install-Package KafkaProducerHost -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="KafkaProducerHost" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KafkaProducerHost" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="KafkaProducerHost" />
                    
Project file
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 KafkaProducerHost --version 1.0.0
                    
#r "nuget: KafkaProducerHost, 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.
#addin nuget:?package=KafkaProducerHost&version=1.0.0
                    
Install KafkaProducerHost as a Cake Addin
#tool nuget:?package=KafkaProducerHost&version=1.0.0
                    
Install KafkaProducerHost as a Cake Tool

KafkaProducerHost

An SDK built on top of the Confluent Kafka .NET client, providing simplified APIs for producing messages, handling retries, schema serialization, and seamless integration with Kafka brokers.

Features

  • Simplified APIs for producing Kafka messages
  • Automatic handling of retries
  • Schema serialization support
  • Seamless integration with Kafka brokers

Getting Started

Prerequisites

  • .NET 6.0 or .NET 8.0

Add KafkaProducerConfig to the appsettings.json file

{
  "KafkaProducerConfig": {
    "BootstrapServers": "localhost:9092"
  }
}

Register the KafkaProducerHost in the service container in your Program.cs or StartUp.cs file:


services.Configure<KafkaProducerConfig>(c=>builder.Configuration.GetSection(nameof(KafkaProducerConfig)).Bind(c));
services.AddKafkaProducerHost(builder.Configuration);

Example Usage

Inject the IKafkaProducer interface into your service and use it to produce messages:

using KafkaProducerHost;


public class MyService
{
    private readonly IKafkaProducer _kafkaProducer;

    public MyService(IKafkaProducer kafkaProducer)
    {
        _kafkaProducer = kafkaProducer;
    }

    public async Task ProduceMessage(string topic, string message)
    {
        await _kafkaProducer.ProduceAsync(topic, message);
    }
}

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on KafkaProducerHost:

Package Downloads
KafkaConsumerTemplateV8

A .NET project template for Kafka consumer applications.

KafkaConsumerMongoDbTemplateV8

A .NET project template for quickly setting up Kafka consumer applications. This template simplifies the process of building robust Kafka consumer services with essential configurations and features like message consumption, dependency injection, and graceful shutdown handling. Perfect for developers working with Apache Kafka in .NET.

DotNetApiMongoDbTemplateV8

DotnetApiMongoDbTemplateV8 is a comprehensive, ready-to-use template for building modern .NET APIs with MongoDB. Designed to simplify and accelerate API development, this template integrates essential tools and follows best practices, making it ideal for developers looking for a solid foundation for their projects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 256 3 months ago

Version 1.0.0 - Initial Release