Shuttle.Esb.Kafka 14.0.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Shuttle.Esb.Kafka --version 14.0.1
NuGet\Install-Package Shuttle.Esb.Kafka -Version 14.0.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="Shuttle.Esb.Kafka" Version="14.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Shuttle.Esb.Kafka --version 14.0.1
#r "nuget: Shuttle.Esb.Kafka, 14.0.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.
// Install Shuttle.Esb.Kafka as a Cake Addin
#addin nuget:?package=Shuttle.Esb.Kafka&version=14.0.1

// Install Shuttle.Esb.Kafka as a Cake Tool
#tool nuget:?package=Shuttle.Esb.Kafka&version=14.0.1

Kafka

PM> Install-Package Shuttle.Esb.Kafka

Configuration

The URI structure is kafka://configuration-name/queue-name.

services.AddKafka(builder =>
{
    var kafkaOptions = new KafkaOptions
    {
        BootstrapServers = "localhost:9092",
        ReplicationFactor = 1,
        NumPartitions = 1,
        MessageSendMaxRetries = 3,
        RetryBackoff = TimeSpan.FromSeconds(1),
        EnableAutoCommit = false,
        EnableAutoOffsetStore = false,
        FlushEnqueue = false,
        UseCancellationToken = true,
        ConsumeTimeout = TimeSpan.FromSeconds(30),
        OperationTimeout = TimeSpan.FromSeconds(30),
        ConnectionsMaxIdle = TimeSpan.Zero,
        Acks = Acks.All,
        EnableIdempotence = true
    };

    kafkaOptions.ConfigureConsumer += (sender, args) =>
    {
        Console.WriteLine($"[event] : ConfigureConsumer / Uri = '{((IQueue)sender).Uri}'");
    };

    kafkaOptions.ConfigureProducer += (sender, args) =>
    {
        Console.WriteLine($"[event] : ConfigureProducer / Uri = '{((IQueue)sender).Uri}'");
    };

    builder.AddOptions("local", kafkaOptions);
});

The ConfigureConsumer event args arugment exposes the ConsumerConfig directly for any specific options that need to be set. Similarly, the ConfigureProducer event args arugment exposes the ProducerConfig.

The default JSON settings structure is as follows:

{
  "Shuttle": {
    "Kafka": {
      "local": {
        "BootstrapServers": "localhost:9092",
        "ReplicationFactor": 1,
        "NumPartitions": 1,
        "MessageSendMaxRetries": 3,
        "RetryBackoff": "00:00:01",
        "EnableAutoCommit": false,
        "EnableAutoOffsetStore": false,
        "FlushEnqueue": false,
        "UseCancellationToken": true,
        "ConsumeTimeout": "00:00:30",
        "OperationTimeout": "00:00:30",
        "ConnectionsMaxIdle": "00:00:00",
        "Acks": "All",
        "EnableIdempotence": true,
      }
    }
  }
}

Options

Option Default Description
BootstrapServers Initial list of brokers as a CSV list of broker host or host:port.
ReplicationFactor 1 The replication factor for the new topic or -1 (the default) if a replica assignment is specified instead.
NumPartitions 1 The number of partitions for the new topic or -1 (the default) if a replica assignment is specified.
MessageSendMaxRetries 3 How many times to retry sending a failing Message. Note: retrying may cause reordering unless enable.idempotence is set to true.
RetryBackoff "00:00:01" The backoff time before retrying a protocol request.
EnableAutoCommit false Automatically and periodically commit offsets in the background.
EnableAutoOffsetStore false Automatically store offset of last message provided to application.
FlushEnqueue false If true will call Flush on the producer after a message has been enqueued.
UseCancellationToken true Indicates whether a cancellation token is used for relevant methods.
ConsumeTimeout "00:00:30" The duration to poll for messages before returning null, when the cancellation token is not used.
OperationTimeout "00:00:30" The duration to wait for relevant async methods to complete before timing out.
ConnectionsMaxIdle "00:00:00" Close broker connections after the specified time of inactivity.
Acks "All" This field indicates the number of acknowledgements the leader broker must receive from ISR brokers before responding to the request.
EnableIdempotence true When set to true, the producer will ensure that messages are successfully produced exactly once and in the original produce order.
Product 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.

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
14.0.1 55 5/3/2024
14.0.0 85 4/30/2024
13.2.1 347 12/1/2022
13.2.0 415 9/16/2022
13.1.0 383 9/11/2022
13.0.0 400 9/4/2022