NetEvolve.HealthChecks.Apache.ActiveMq
4.15.1
dotnet add package NetEvolve.HealthChecks.Apache.ActiveMq --version 4.15.1
NuGet\Install-Package NetEvolve.HealthChecks.Apache.ActiveMq -Version 4.15.1
<PackageReference Include="NetEvolve.HealthChecks.Apache.ActiveMq" Version="4.15.1" />
<PackageVersion Include="NetEvolve.HealthChecks.Apache.ActiveMq" Version="4.15.1" />
<PackageReference Include="NetEvolve.HealthChecks.Apache.ActiveMq" />
paket add NetEvolve.HealthChecks.Apache.ActiveMq --version 4.15.1
#r "nuget: NetEvolve.HealthChecks.Apache.ActiveMq, 4.15.1"
#:package NetEvolve.HealthChecks.Apache.ActiveMq@4.15.1
#addin nuget:?package=NetEvolve.HealthChecks.Apache.ActiveMq&version=4.15.1
#tool nuget:?package=NetEvolve.HealthChecks.Apache.ActiveMq&version=4.15.1
NetEvolve.HealthChecks.Apache.ActiveMq
This package provides a health check for Apache ActiveMQ, based on the Apache.NMS.ActiveMQ package. The main purpose is to check that the ActiveMQ broker 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.Apache.ActiveMq
Health Check - Apache ActiveMQ Liveness
The health check is a liveness check. It will check that the ActiveMQ broker is reachable and that the client can connect to it.
If the broker needs longer than the configured timeout to respond, the health check will return Degraded
.
If the broker is not reachable, the health check will return Unhealthy
.
Usage
After adding the package, you need to import the namespace NetEvolve.HealthChecks.Apache.ActiveMq
and add the health check to the service collection.
using NetEvolve.HealthChecks.Apache.ActiveMq;
Therefore, you can use two different approaches. In both approaches you have to provide a name for the health check.
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 tagsactivemq
andmessaging
are 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:ActiveMq
to your appsettings.json
file.
var builder = services.AddHealthChecks();
builder.AddActiveMq("<name>");
The configuration looks like this:
{
..., // other configuration
"HealthChecks": {
"ActiveMq": {
"<name>": {
"BrokerAddress": "<broker-uri>", // required
"Username": "<username>", // optional, default is null
"Password": "<password>", // optional, default is null
"Timeout": "<timeout>" // optional, default is 100 milliseconds
}
}
}
}
Variant 2: Builder based
The second approach is to use the builder based approach. This approach is recommended if you have only one ActiveMQ instance to check or dynamic programmatic values.
var builder = services.AddHealthChecks();
builder.AddActiveMq("<name>", options =>
{
options.BrokerAddress = "<broker-uri>"; // required
options.Username = "<username>"; // optional, default is null
options.Password = "<password>"; // optional, default is null
options.Timeout = "<timeout>"; // optional, default is 100 milliseconds
});
💡 You can always provide tags to all health checks, for grouping or filtering.
var builder = services.AddHealthChecks();
builder.AddActiveMq("<name>", options => ..., "activemq");
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 was computed. 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. |
-
net8.0
- Apache.NMS.ActiveMQ (>= 2.1.1)
- NetEvolve.Arguments (>= 1.3.84)
- NetEvolve.Extensions.Tasks (>= 1.3.74)
- NetEvolve.HealthChecks.Abstractions (>= 4.15.1)
-
net9.0
- Apache.NMS.ActiveMQ (>= 2.1.1)
- NetEvolve.Arguments (>= 1.3.84)
- NetEvolve.Extensions.Tasks (>= 1.3.74)
- NetEvolve.HealthChecks.Abstractions (>= 4.15.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.