NPipeline.Connectors.Kafka 0.54.0

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

NPipeline.Connectors.Kafka

Apache Kafka connector for NPipeline - integrate with Kafka for high-throughput streaming with multiple serialization formats and delivery semantics.

Features

  • Source & Sink Nodes: Read from and write to Kafka topics with type-safe message handling
  • Multiple Serialization Formats: JSON (default), Apache Avro, and Protocol Buffers with Schema Registry support
  • Flexible Delivery Semantics: At-least-once (default) and exactly-once delivery guarantees
  • Idempotent Production: Prevent duplicate messages with configurable acknowledgment modes
  • Partition Management: Custom partition key providers for sophisticated message routing
  • Consumer Groups: Offset management and parallel processing across partitions
  • Message Acknowledgment: Manual control over offset commits with acknowledgment callbacks
  • Error Handling: Exponential backoff retry strategies for transient errors
  • Kafka Authentication: Support for SASL/PLAIN and SASL/SSL security protocols
  • Message Metadata: Access to Kafka-specific properties (topic, partition, offset, timestamp, headers)
  • Dead-Letter Envelope: Optional DeadLetterEnvelope model for custom routing
  • Monitoring: Built-in metrics collection for production observability

Installation

dotnet add package NPipeline.Connectors.Kafka

Quick Start

Reading from Kafka

using NPipeline.Connectors.Kafka.Configuration;
using NPipeline.Connectors.Kafka.Models;
using NPipeline.Connectors.Kafka.Nodes;
using NPipeline.Pipeline;

public record Order(string OrderId, string CustomerId, decimal Amount);

var config = new KafkaConfiguration
{
    BootstrapServers = "localhost:9092",
    SourceTopic = "orders",
    ConsumerGroupId = "order-processor",
    AutoOffsetReset = AutoOffsetReset.Latest,
};

var source = new KafkaSourceNode<Order>(config);

var sourceHandle = builder.AddSource(source, "kafka-source");
var sinkHandle = builder.AddSink(async (KafkaMessage<Order> message, CancellationToken ct) =>
{
    Console.WriteLine($"Processing: {message.Body.OrderId}");
    await message.AcknowledgeAsync(ct);
}, "process-order");

builder.Connect(sourceHandle, sinkHandle);

Writing to Kafka

using NPipeline.Connectors.Kafka.Configuration;
using NPipeline.Connectors.Kafka.Nodes;
using NPipeline.Pipeline;

public record OrderEvent(string OrderId, string EventType, DateTime Timestamp);

var config = new KafkaConfiguration
{
    BootstrapServers = "localhost:9092",
    SinkTopic = "order-events",
    Acks = Acks.All,
};

var sink = new KafkaSinkNode<OrderEvent>(config);

var sourceHandle = builder.AddSource(() => new[]
{
    new OrderEvent("ORD-001", "Created", DateTime.UtcNow),
    new OrderEvent("ORD-002", "Shipped", DateTime.UtcNow),
}, "orders-source");

var sinkHandle = builder.AddSink(sink, "kafka-sink");

builder.Connect(sourceHandle, sinkHandle);

Serialization Formats

// JSON (default, no Schema Registry needed)
var config = new KafkaConfiguration
{
    SerializationFormat = SerializationFormat.Json,
};

// Avro with Schema Registry
var config = new KafkaConfiguration
{
    SerializationFormat = SerializationFormat.Avro,
    SchemaRegistry = new SchemaRegistryConfiguration
    {
        Url = "http://localhost:8081",
        AutoRegisterSchemas = true,
    },
};

// Protocol Buffers with Schema Registry
var config = new KafkaConfiguration
{
    SerializationFormat = SerializationFormat.Protobuf,
    SchemaRegistry = new SchemaRegistryConfiguration
    {
        Url = "http://localhost:8081",
    },
};

Delivery Semantics

// At-least-once (default)
var config = new KafkaConfiguration
{
    DeliverySemantic = DeliverySemantic.AtLeastOnce,
};

// Exactly-once
var config = new KafkaConfiguration
{
    DeliverySemantic = DeliverySemantic.ExactlyOnce,
    EnableTransactions = true,
    TransactionalId = "order-processor-1",
    EnableIdempotence = true,
    Acks = Acks.All,
};

Tuning

var config = new KafkaConfiguration
{
    PollTimeoutMs = 100,            // Consumer poll timeout
    TransactionInitTimeoutMs = 30000, // Transaction init timeout
};

Authentication

// SASL/Plain over TLS
var config = new KafkaConfiguration
{
    BootstrapServers = "kafka.example.com:9092",
    SecurityProtocol = SecurityProtocol.SaslSsl,
    SaslMechanism = SaslMechanism.Plain,
    SaslUsername = "username",
    SaslPassword = "password",
};

Documentation

For comprehensive documentation, including advanced topics, partitioning, dead letter handling, and best practices, see the Kafka Connector Documentation.

Requirements

  • .NET 8.0, 9.0, or 10.0
  • Confluent.Kafka 2.6.1+ (automatically included)
  • Confluent.SchemaRegistry 2.6.1+ for Avro/Protobuf support

License

This package is licensed under the Business Source License 1.1.

Free for non-production use. Production use is free for organizations with 4 or fewer developers and annual revenue of $5M AUD or less. Larger organizations require a commercial license. This license automatically converts to MIT two years after each release.

Product 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 is compatible.  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 is compatible.  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.

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
0.54.0 37 9/19/2026
0.53.2 92 9/9/2026
0.53.1 196 6/12/2026
0.53.0 121 6/11/2026
0.52.0 116 5/30/2026
0.51.1 118 5/29/2026
0.51.0 107 5/29/2026
0.50.0 140 5/29/2026
0.49.3 129 5/28/2026
0.49.2 115 5/27/2026
0.49.1 108 5/27/2026
0.49.0 116 5/25/2026
0.48.3 124 5/22/2026
0.48.2 115 5/19/2026
0.48.1 113 5/17/2026
0.48.0 111 5/17/2026
0.47.0 110 5/16/2026
0.46.0 106 5/16/2026
0.45.0 116 5/15/2026
0.44.0 112 5/14/2026
Loading failed