JorgeCostaMacia.Bus.Kafka.HealthChecks
3.2.2
Prefix Reserved
dotnet add package JorgeCostaMacia.Bus.Kafka.HealthChecks --version 3.2.2
NuGet\Install-Package JorgeCostaMacia.Bus.Kafka.HealthChecks -Version 3.2.2
<PackageReference Include="JorgeCostaMacia.Bus.Kafka.HealthChecks" Version="3.2.2" />
<PackageVersion Include="JorgeCostaMacia.Bus.Kafka.HealthChecks" Version="3.2.2" />
<PackageReference Include="JorgeCostaMacia.Bus.Kafka.HealthChecks" />
paket add JorgeCostaMacia.Bus.Kafka.HealthChecks --version 3.2.2
#r "nuget: JorgeCostaMacia.Bus.Kafka.HealthChecks, 3.2.2"
#:package JorgeCostaMacia.Bus.Kafka.HealthChecks@3.2.2
#addin nuget:?package=JorgeCostaMacia.Bus.Kafka.HealthChecks&version=3.2.2
#tool nuget:?package=JorgeCostaMacia.Bus.Kafka.HealthChecks&version=3.2.2
JorgeCostaMacia.Bus.Kafka.HealthChecks
Health check for JorgeCostaMacia.Bus.Kafka — reports whether the bus reaches the Kafka brokers, for ASP.NET Core health endpoints (liveness/readiness). No probe connection, no extra I/O: the check reads a reachability tracker the transport already feeds — the client's all brokers down signal flips it down, any successful produce or consumed delivery flips it back up. A separate package so the transport stays free of the HealthChecks dependency.
Install
dotnet add package JorgeCostaMacia.Bus.Kafka.HealthChecks
Usage
One AddKafkaBus call plugs the check onto the standard health-check pipeline — after AddBusContext, which registers the reachability tracker the check reads. Tag it (typically "ready") to pick which health endpoints run it.
services.AddBusContext(configuration,
producer => producer.AddCommand<PlaceOrder>("orders"));
services.AddHealthChecks().AddKafkaBus(tags: ["ready"]);
The check reports:
- Healthy — the bus reaches the brokers, or nothing has been observed yet: an untouched bus counts as reachable, so a service that has not produced or consumed is not a failure.
- The registration's failure status (
Unhealthyby default; passfailureStatusto soften it) — the client reported every broker down (librdkafka's all brokers down); the client keeps reconnecting on its own, and the first successful produce or consumed delivery flips the check back to healthy. The result's data carries the UTC instant of the flip underchangedAt, so the endpoint shows how long the outage has held.
A single failed produce does not flip the check — only the client's whole-broker-set signal does; per-message failures belong to the bus's retry and parking lanes.
The check registers under the name bus-kafka (override it with name when one service runs several buses).
Requirements
One of the following SDKs: .NET 8 / 9 / 10 (.NET 10 recommended).
Brings JorgeCostaMacia.Bus.Kafka (the bus over Kafka) and Microsoft.Extensions.Diagnostics.HealthChecks transitively.
About
JorgeCostaMacia.Bus.Kafka.HealthChecks is part of bus-net — messaging building blocks, each scoped to a single concern.
- Repository: github.com/JorgeCostaMacia/bus-net
- Issues & requests: open an issue
- Contributing: CONTRIBUTING.md
- Security: report a vulnerability
Author: Jorge Costa Maciá
| Product | Versions 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. |
-
net10.0
- JorgeCostaMacia.Bus.Kafka (>= 3.2.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.10)
-
net8.0
- JorgeCostaMacia.Bus.Kafka (>= 3.2.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.10)
-
net9.0
- JorgeCostaMacia.Bus.Kafka (>= 3.2.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.