Example #1
0
 /// <summary>
 /// Add a health check for Azure Service Bus Subscription.
 /// </summary>
 /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param>
 /// <param name="connectionString">The Azure ServiceBus connection string to be used.</param>
 /// <param name="topicName">The topic name of the topic to check.</param>
 /// <param name="subscriptionName">The subscription name of the topic to check.</param>
 /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'azuretopic' will be used for the name.</param>
 /// <param name="failureStatus">
 /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then
 /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported.
 /// </param>
 /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param>
 /// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param>
 /// <returns>The specified <paramref name="builder"/>.</returns>
 public static IHealthChecksBuilder AddAzureServiceBusSubscription(
     this IHealthChecksBuilder builder,
     string connectionString,
     string topicName,
     string subscriptionName,
     string?name = default,
     HealthStatus?failureStatus = default,
     IEnumerable <string>?tags  = default,
     TimeSpan?timeout           = default) =>
 builder.AddAzureServiceBusSubscription(
     _ => connectionString,
     _ => topicName,
     _ => subscriptionName,
     name,
     failureStatus,
     tags,
     timeout);
Example #2
0
 /// <summary>
 /// Add a health check for Azure Service Bus Subscription.
 /// </summary>
 /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param>
 /// <param name="endpoint">The azure service bus endpoint to be used, format sb://myservicebus.servicebus.windows.net/.</param>
 /// <param name="topicName">The topic name of the topic to check.</param>
 /// <param name="subscriptionName">The subscription name of the topic to check.</param>
 /// <param name="tokenCredential">The token credential for auth.</param>
 /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'azuretopic' will be used for the name.</param>
 /// <param name="failureStatus">
 /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then
 /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported.
 /// </param>
 /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param>
 /// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param>
 /// <returns>The specified <paramref name="builder"/>.</returns>
 public static IHealthChecksBuilder AddAzureServiceBusSubscription(
     this IHealthChecksBuilder builder,
     string endpoint,
     string topicName,
     string subscriptionName,
     TokenCredential tokenCredential,
     string?name = default,
     HealthStatus?failureStatus = default,
     IEnumerable <string>?tags  = default,
     TimeSpan?timeout           = default) =>
 builder.AddAzureServiceBusSubscription(
     _ => endpoint,
     _ => topicName,
     _ => subscriptionName,
     _ => tokenCredential,
     name,
     failureStatus,
     tags,
     timeout);