Class ConsumersHealthCheck
- Namespace
- Silverback.Messaging.HealthChecks
- Assembly
- Silverback.Integration.HealthChecks.dll
Verifies whether all consumers are connected.
public class ConsumersHealthCheck : IHealthCheck
- Inheritance
-
ConsumersHealthCheck
- Implements
- Inherited Members
Constructors
ConsumersHealthCheck(IConsumersHealthCheckService, ConsumerStatus, TimeSpan)
Initializes a new instance of the ConsumersHealthCheck class.
public ConsumersHealthCheck(IConsumersHealthCheckService service, ConsumerStatus minHealthyStatus, TimeSpan gracePeriod)
Parameters
serviceIConsumersHealthCheckServiceThe IConsumersHealthCheckService implementation to be used to check the consumers.
minHealthyStatusConsumerStatusThe minimum ConsumerStatus a consumer must have to be considered healthy.
gracePeriodTimeSpanThe grace period to observe after each status change before a consumer is considered unhealthy.
Methods
CheckHealthAsync(HealthCheckContext, CancellationToken)
Runs the health check, returning the status of the component being checked.
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
Parameters
contextHealthCheckContextA context object associated with the current execution.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the health check.
Returns
- Task<HealthCheckResult>
A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked.