Class OutboxHealthCheck
- Namespace
- Silverback.Messaging.HealthChecks
- Assembly
- Silverback.Integration.HealthChecks.dll
Monitors the outbox, verifying that the messages are being processed.
public class OutboxHealthCheck : IHealthCheck
- Inheritance
-
OutboxHealthCheck
- Implements
- Inherited Members
Constructors
OutboxHealthCheck(IOutboxHealthCheckService, TimeSpan, int?)
Initializes a new instance of the OutboxHealthCheck class.
public OutboxHealthCheck(IOutboxHealthCheckService service, TimeSpan maxAge, int? maxQueueLength = null)
Parameters
serviceIOutboxHealthCheckServiceThe IOutboxHealthCheckService implementation to be used to monitor the outbox.
maxAgeTimeSpanThe maximum message age, the check will fail when a message exceeds this age.
maxQueueLengthint?The maximum amount of messages in the queue. The default is null, meaning unrestricted.
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.