NetEvolve.HealthChecks.Azure.EventHubs
5.8.0
Prefix Reserved
See the version list below for details.
dotnet add package NetEvolve.HealthChecks.Azure.EventHubs --version 5.8.0
NuGet\Install-Package NetEvolve.HealthChecks.Azure.EventHubs -Version 5.8.0
<PackageReference Include="NetEvolve.HealthChecks.Azure.EventHubs" Version="5.8.0" />
<PackageVersion Include="NetEvolve.HealthChecks.Azure.EventHubs" Version="5.8.0" />
<PackageReference Include="NetEvolve.HealthChecks.Azure.EventHubs" />
paket add NetEvolve.HealthChecks.Azure.EventHubs --version 5.8.0
#r "nuget: NetEvolve.HealthChecks.Azure.EventHubs, 5.8.0"
#:package NetEvolve.HealthChecks.Azure.EventHubs@5.8.0
#addin nuget:?package=NetEvolve.HealthChecks.Azure.EventHubs&version=5.8.0
#tool nuget:?package=NetEvolve.HealthChecks.Azure.EventHubs&version=5.8.0
NetEvolve.HealthChecks.Azure.EventHubs
This package provides a health check for Azure Event Hubs, based on the Azure.Messaging.EventHubs package. The main purpose is to check that the Azure Event Hubs namespace is reachable and that the client can connect to it.
💡 This package is available for .NET 8.0 and later.
Installation
To use this package, you need to add the package to your project. You can do this by using the NuGet package manager or by using the dotnet CLI.
dotnet add package NetEvolve.HealthChecks.Azure.EventHubs
Usage
After adding the package, you need to import the namespace NetEvolve.HealthChecks.Azure.EventHubs and add the health check to the service collection.
using NetEvolve.HealthChecks.Azure.EventHubs;
Therefore, you can use two different approaches. In both approaches you have to provide a name for the health check.
Health Check - Azure Event Hubs
The health check is a readiness check. It will check that the Azure Event Hubs namespace is reachable and that the client can connect to it. If the service needs longer than the configured timeout to respond, the health check will return Degraded. If the service is not reachable, the health check will return Unhealthy.
Parameters
name: The name of the health check. The name is used to identify the configuration object. It is required and must be unique within the application.options: The configuration options for the health check. If you don't provide any options, the health check will use the configuration based approach.tags: The tags for the health check. The tagsazure,eventhubsandmessagingare always used as default and combined with the user input. You can provide additional tags to group or filter the health checks.
Variant 1: Configuration based
The first one is to use the configuration based approach. Therefore, you have to add the configuration section HealthChecks:AzureEventHubs to your appsettings.json file.
var builder = services.AddHealthChecks();
builder.AddAzureEventHubs("<name>");
The configuration looks like this:
{
..., // other configuration
"HealthChecks": {
"AzureEventHubs": {
"<name>": {
"ConnectionString": "<connection-string>", // required when Mode is ConnectionString
"Mode": "<mode>", // required, to specify the client creation mode, either `ServiceProvider`, `DefaultAzureCredentials` or `ConnectionString`
"EventHubName": "<event-hub-name>", // required
"FullyQualifiedNamespace": "<fully-qualified-namespace>", // required when Mode is DefaultAzureCredentials
"Timeout": "<timeout>" // optional, default is 100 milliseconds
}
}
}
}
Variant 2: Options based
The second one is to use the options based approach. Therefore, you have to create an instance of EventHubsOptions and provide the configuration.
var builder = services.AddHealthChecks();
builder.AddAzureEventHubs("<name>", options =>
{
options.ConnectionString = "<connection-string>";
options.Mode = ClientCreationMode.ServiceProvider; // or DefaultAzureCredentials or ConnectionString
options.EventHubName = "<event-hub-name>";
options.Timeout = TimeSpan.FromMilliseconds(100); // optional, default is 100 milliseconds
});
💡 You can always provide tags to all health checks, for grouping or filtering.
var builder = services.AddHealthChecks();
builder.AddAzureEventHubs("<name>", options => ..., "azure-eventhubs");
License
This project is licensed under the MIT License - see the LICENSE file for details.
| 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
- Azure.Identity (>= 1.17.1)
- Azure.Messaging.EventHubs (>= 5.12.2)
- NetEvolve.Extensions.Tasks (>= 2.0.11)
-
net8.0
- Azure.Identity (>= 1.17.1)
- Azure.Messaging.EventHubs (>= 5.12.2)
- NetEvolve.Extensions.Tasks (>= 2.0.11)
-
net9.0
- Azure.Identity (>= 1.17.1)
- Azure.Messaging.EventHubs (>= 5.12.2)
- NetEvolve.Extensions.Tasks (>= 2.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NetEvolve.HealthChecks.Azure.EventHubs:
| Package | Downloads |
|---|---|
|
NetEvolve.HealthChecks.Azure
Contains HealthChecks for various Azure services. |
GitHub repositories
This package is not used by any popular GitHub repositories.