Class HealthCheckBuilderExtensions
- Namespace
- Silverback.Messaging.HealthChecks
- Assembly
- Silverback.Integration.HealthChecks.dll
Adds methods such as AddConsumersCheck(IHealthChecksBuilder, ConsumerStatus, TimeSpan?, string, HealthStatus?, IEnumerable<string>?) and AddOutboxCheck(IHealthChecksBuilder, TimeSpan?, int?, string, HealthStatus?, IEnumerable<string>?) to the IHealthChecksBuilder.
public static class HealthCheckBuilderExtensions
- Inheritance
-
HealthCheckBuilderExtensions
- Inherited Members
Methods
AddConsumersCheck(IHealthChecksBuilder, ConsumerStatus, TimeSpan?, string, HealthStatus?, IEnumerable<string>?)
Adds a health check that verifies that all consumers are connected.
public static IHealthChecksBuilder AddConsumersCheck(this IHealthChecksBuilder builder, ConsumerStatus minHealthyStatus = ConsumerStatus.Connected, TimeSpan? gracePeriod = null, string name = "Consumers", HealthStatus? failureStatus = null, IEnumerable<string>? tags = null)
Parameters
builderIHealthChecksBuilderThe IHealthChecksBuilder.
minHealthyStatusConsumerStatusThe minimum ConsumerStatus a consumer must have to be considered healthy.
gracePeriodTimeSpan?The grace period to observe after each status change before a consumer is considered unhealthy.
namestringThe health check name. The default is "Consumers".
failureStatusHealthStatus?The HealthStatus that should be reported when the health check reports a failure. The default is Unhealthy.
tagsIEnumerable<string>An optional list of tags that can be used for filtering health checks.
Returns
- IHealthChecksBuilder
The IHealthChecksBuilder so that additional calls can be chained.
AddOutboxCheck(IHealthChecksBuilder, TimeSpan?, int?, string, HealthStatus?, IEnumerable<string>?)
Adds a health check that monitors the outbox, verifying that the messages are being processed.
public static IHealthChecksBuilder AddOutboxCheck(this IHealthChecksBuilder builder, TimeSpan? maxAge = null, int? maxQueueLength = null, string name = "Outbox", HealthStatus? failureStatus = null, IEnumerable<string>? tags = null)
Parameters
builderIHealthChecksBuilderThe IHealthChecksBuilder.
maxAgeTimeSpan?The maximum message age, the check will fail when a message exceeds this age. The default is 30 seconds.
maxQueueLengthint?The maximum amount of messages in the queue. The default is null, meaning unrestricted.
namestringThe health check name. The default is "OutboundQueue".
failureStatusHealthStatus?The HealthStatus that should be reported when the health check reports a failure. The default is Unhealthy.
tagsIEnumerable<string>An optional list of tags that can be used for filtering health checks.
Returns
- IHealthChecksBuilder
The IHealthChecksBuilder so that additional calls can be chained.