Installation
Example Usage
With all of the following examples, you can additionally add the following parameters:name
: The health check name. Default if not specified israbbitmq
.failureStatus
: TheHealthStatus
that should be reported when the health check fails. Default isHealthStatus.Unhealthy
.tags
: A list of tags that can be used to filter sets of health checks.timeout
: ASystem.TimeSpan
representing the timeout of the check.
Basic
This will create a newIConnection
and reuse on every request to get the health check result. Use
the extension method where you provide the Uri
to connect with. You can optionally set the SslOption
if needed.
IConnection created with this option use UseBackgroundThreadsForIO by default in order to gracefully shutdown on non reference IConnection by ServiceCollection.
Dependency Injected IConnection
As per RabbitMQ docs and its suggestions on
high connectivity churn, connections are meant to be long lived.
Ideally, this should be configured as a singleton.
If you are sharing a single connection for every time a health check is requested,
you must ensure automatic recovery is enable so that the connection can be re-established if lost.
IServiceProvider
.