Franz.Common.Messaging.Kafka
3.0.0
dotnet add package Franz.Common.Messaging.Kafka --version 3.0.0
NuGet\Install-Package Franz.Common.Messaging.Kafka -Version 3.0.0
<PackageReference Include="Franz.Common.Messaging.Kafka" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Messaging.Kafka" Version="3.0.0" />
<PackageReference Include="Franz.Common.Messaging.Kafka" />
paket add Franz.Common.Messaging.Kafka --version 3.0.0
#r "nuget: Franz.Common.Messaging.Kafka, 3.0.0"
#:package Franz.Common.Messaging.Kafka@3.0.0
#addin nuget:?package=Franz.Common.Messaging.Kafka&version=3.0.0
#tool nuget:?package=Franz.Common.Messaging.Kafka&version=3.0.0
Franz.Common.Messaging.Kafka
Kafka producer, consumer, administration, topic provisioning, manifest validation, and transactional publishing integration.
Overview
The Kafka adapter implements Franz's broker-neutral messaging contracts using Confluent.Kafka. It supports service-level topic mode and event-based topic mode, configurable provisioning, producer/consumer options, security, dead-letter behavior, and generated messaging-manifest validation.
Installation
dotnet add package Franz.Common.Messaging.Kafka
Service-level topic mode
using Franz.Common.Messaging.Kafka.Extensions;
builder.Services.AddKafkaMessaging(builder.Configuration);
This binds KafkaMessagingOptions from Messaging:Kafka and registers the Kafka admin, producer, consumer, sender, publisher, transaction, serializer, and topic-initialization infrastructure.
Event-based topic mode
For one topic per handled integration-event type:
using Franz.Common.Messaging.Kafka.Extensions;
builder.Services.AddFranzMediator(new[] { typeof(Program).Assembly });
builder.Services.AddEventBasedKafkaMessaging(builder.Configuration);
The parameterless event-based overload derives subscriptions from the generated messaging manifest. An explicit overload accepts params Type[] eventTypes; each supplied type must be a concrete IIntegrationEvent and simple type names must be unique. Configured subscriptions are checked against the generated manifest. Register Mediator and its manifest contribution before event-based Kafka registration.
Configuration
The default section is Messaging:Kafka:
{
"Messaging": {
"Kafka": {
"BootstrapServers": "localhost:9092",
"GroupId": "orders",
"ClientId": "orders-api",
"ProvisioningMode": "Create",
"Security": {
"SecurityProtocol": "Plaintext",
"AllowInsecureTransport": true
},
"Consumer": {
"EnableAutoCommit": false,
"EnableAutoOffsetStore": false,
"ConcurrencyLevel": 1
},
"Producer": {
"Acks": "All",
"EnableIdempotence": true,
"CompressionType": "Snappy"
},
"Topic": {
"NumPartitions": 3,
"ReplicationFactor": 1
}
}
}
}
The example uses plaintext only for isolated development. For production, configure TLS/SASL deliberately and keep credentials/certificates in protected deployment configuration. The options validator rejects insecure transport unless it is explicitly allowed.
If ProvisioningMode is omitted, development defaults to Create; non-development environments default to Verify. Supported modes are Create, Verify, and Off. Topic settings can be customized globally and per event topic, including dead-letter topics.
Hosting
The adapter registers transport services but does not start a hosted listener by itself. Add Franz.Common.Messaging.Hosting.Kafka and call AddKafkaHostedListener(options => ...) to attach consumption to the generic host. That callback accepts Action<KafkaMessagingOptions>, not an IConfiguration parameter.
Transactions and failure handling
Use the registered IMessagingTransaction when a producer transaction is required. Transactional producer settings include idempotence, transaction timeout, and an optional transactional ID prefix. Validate broker transaction settings and topic replication against the target Kafka cluster.
License
MIT. See the repository LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Confluent.Kafka (>= 2.15.0)
- Franz.Common.Annotations (>= 3.0.0)
- Franz.Common.Hosting (>= 3.0.0)
- Franz.Common.Messaging (>= 3.0.0)
- Franz.Common.Messaging.Hosting (>= 3.0.0)
- SharpCompress (>= 0.50.7)
- Snappier (>= 1.3.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Franz.Common.Messaging.Kafka:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.Hosting.Kafka
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 102 | 11/10/2026 |
| 2.3.4 | 368 | 11/1/2026 |
| 2.3.3 | 325 | 10/28/2026 |
| 2.3.2 | 121 | 10/27/2026 |
| 2.3.1 | 179 | 10/26/2026 |
| 2.3.0 | 200 | 7/21/2026 |
| 2.2.19 | 152 | 7/19/2026 |
| 2.2.18 | 150 | 7/19/2026 |
| 2.2.17 | 160 | 7/12/2026 |
| 2.2.16 | 151 | 7/2/2026 |
| 2.2.15 | 153 | 6/29/2026 |
| 2.2.14 | 149 | 6/29/2026 |
| 2.2.13 | 153 | 6/29/2026 |
| 2.2.12 | 144 | 6/28/2026 |
| 2.2.11 | 146 | 6/28/2026 |
| 2.2.10 | 149 | 6/28/2026 |
| 2.2.9 | 154 | 6/28/2026 |
| 2.2.8 | 147 | 6/28/2026 |
| 2.2.7 | 161 | 6/7/2026 |
| 2.2.6 | 157 | 6/6/2026 |