コード例 #1
0
        /// <inheritdoc/>
        public override async Task <bool> CheckHealthAsync(Dictionary <string, object> data,
                                                           CancellationToken cancellationToken = default)
        {
            Logger.LogDebug("Listing Queues ...");
            var queues = managementClient.GetQueuesRuntimePropertiesAsync(cancellationToken).AsPages();

            await foreach (var _ in queues)
            {
                ;                             // there's nothing to do
            }
            if (!TransportOptions.UseBasicTier)
            {
                Logger.LogDebug("Listing Topics ...");
                var topics = managementClient.GetTopicsRuntimePropertiesAsync(cancellationToken);
                await foreach (var t in topics)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    Logger.LogDebug("Listing Subscriptions for '{TopicName}' topic ...", t.Name);
                    var subscriptions = managementClient.GetSubscriptionsRuntimePropertiesAsync(t.Name, cancellationToken);
                    await foreach (var _ in subscriptions)
                    {
                        ;                                    // there's nothing to do
                    }
                }
            }
            return(true);
        }