Class ConsumersHealthCheckService
- Namespace
- Silverback.Messaging.HealthChecks
- Assembly
- Silverback.Integration.dll
Checks that all the consumers are connected.
public class ConsumersHealthCheckService : IConsumersHealthCheckService
- Inheritance
-
ConsumersHealthCheckService
- Implements
- Inherited Members
Constructors
ConsumersHealthCheckService(IConsumerCollection, IHostApplicationLifetime)
Initializes a new instance of the ConsumersHealthCheckService class.
public ConsumersHealthCheckService(IConsumerCollection consumerCollection, IHostApplicationLifetime applicationLifetime)
Parameters
consumerCollectionIConsumerCollectionThe collection holding a reference to all consumers.
applicationLifetimeIHostApplicationLifetimeThe IHostApplicationLifetime used to track the application shutdown.
Methods
GetDisconnectedConsumersAsync(ConsumerStatus, TimeSpan)
Checks the status of all the consumers and returns a collection containing the consumer instances that don't appear to be fully connected (Status >= Connected).
public Task<IReadOnlyCollection<IConsumer>> GetDisconnectedConsumersAsync(ConsumerStatus minStatus, TimeSpan gracePeriod)
Parameters
minStatusConsumerStatusThe minimum ConsumerStatus a consumer must have to be considered fully connected.
gracePeriodTimeSpanThe grace period to observe after each status change before a consumer is considered unhealthy.
Returns
- Task<IReadOnlyCollection<IConsumer>>
A Task<TResult> representing the asynchronous operation. The task result contains the consumers that aren't fully connected.