Class ConsumersHealthCheck
Verifies whether all consumers are connected.
Implements
Inherited Members
Namespace: Silverback.Messaging.HealthChecks
Assembly: Silverback.Integration.HealthChecks.dll
Syntax
public class ConsumersHealthCheck : IHealthCheck
Constructors
| Improve this doc View sourceConsumersHealthCheck(IConsumersHealthCheckService, ConsumerStatus, TimeSpan, Func<IConsumerEndpoint, bool>?)
Initializes a new instance of the ConsumersHealthCheck class.
Declaration
public ConsumersHealthCheck(IConsumersHealthCheckService service, ConsumerStatus minHealthyStatus, TimeSpan gracePeriod, Func<IConsumerEndpoint, bool>? endpointsFilter)
Parameters
Type | Name | Description |
---|---|---|
IConsumersHealthCheckService | service | The IConsumersHealthCheckService implementation to be used to check the consumers. |
ConsumerStatus | minHealthyStatus | The minimum ConsumerStatus a consumer must have to be considered healthy. |
TimeSpan | gracePeriod | The grace period to observe after each status change before a consumer is considered unhealthy. |
Func<IConsumerEndpoint, bool> | endpointsFilter | An optional filter to be applied to the endpoints to be tested. |
Methods
| Improve this doc View sourceCheckHealthAsync(HealthCheckContext, CancellationToken)
Runs the health check, returning the status of the component being checked.
Declaration
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckContext | context | A context object associated with the current execution. |
CancellationToken | cancellationToken | A CancellationToken that can be used to cancel the health check. |
Returns
Type | Description |
---|---|
Task<HealthCheckResult> | A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked. |