Table of Contents

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

service IOutboxHealthCheckService

The IOutboxHealthCheckService implementation to be used to monitor the outbox.

maxAge TimeSpan

The maximum message age, the check will fail when a message exceeds this age.

maxQueueLength int?

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

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.