Anarchy.Toolkit.Testing.Kafka
1.0.0
dotnet add package Anarchy.Toolkit.Testing.Kafka --version 1.0.0
NuGet\Install-Package Anarchy.Toolkit.Testing.Kafka -Version 1.0.0
<PackageReference Include="Anarchy.Toolkit.Testing.Kafka" Version="1.0.0" />
<PackageVersion Include="Anarchy.Toolkit.Testing.Kafka" Version="1.0.0" />
<PackageReference Include="Anarchy.Toolkit.Testing.Kafka" />
paket add Anarchy.Toolkit.Testing.Kafka --version 1.0.0
#r "nuget: Anarchy.Toolkit.Testing.Kafka, 1.0.0"
#:package Anarchy.Toolkit.Testing.Kafka@1.0.0
#addin nuget:?package=Anarchy.Toolkit.Testing.Kafka&version=1.0.0
#tool nuget:?package=Anarchy.Toolkit.Testing.Kafka&version=1.0.0
Anarchy.Toolkit.Testing.Kafka
Part of Anarchy I/O Toolkit · Pillar: Infrastructure · Layer: Testing · Package catalog
Helpers for testing Infrastructure.Messaging.Kafka: KafkaMessageFixture.FromOutbound makes a consumed record without a broker, while KafkaTestConsumer reads a real Kafka-compatible broker from the beginning of a specified partition.
using Anarchy.Toolkit.Testing.Kafka.Helper;
using Confluent.Kafka;
// Create a unique topic and publish before reading. Supply your test broker configuration.
using var consumer = new KafkaTestConsumer(new ConsumerConfig {
BootstrapServers = "localhost:9092", GroupId = Guid.NewGuid().ToString(),
EnableAutoCommit = false
}, topic);
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var message = consumer.Read(timeout.Token);
The helper does not provision or clean up topics, explicitly commit offsets, or start a broker. Disable auto commit, use isolated topics and configure the broker separately. A fixture is useful for unit tests but is not a substitute for a real-broker integration test.
Releases
See the release notes for the complete release history.
| 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
- Anarchy.Toolkit.Infrastructure.Messaging.Kafka (>= 1.0.0)
- Confluent.Kafka (>= 2.16.0)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
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 |
|---|---|---|
| 1.0.0 | 46 | 11/24/2026 |
## Releases
### 1.0.0
- Introduced a Kafka record fixture and real-broker test consumer.