Table of Contents

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

service IConsumersHealthCheckService

The IConsumersHealthCheckService implementation to be used to check the consumers.

minHealthyStatus ConsumerStatus

The minimum ConsumerStatus a consumer must have to be considered healthy.

gracePeriod TimeSpan

The 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

context HealthCheckContext

A context object associated with the current execution.

cancellationToken CancellationToken

A 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.