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