コード例 #1
0
        private async Task ProcessMessagesInDeadLetterQueueInternal(string queueOrTopicName, string subscriptionName, object message)
        {
            if (string.IsNullOrWhiteSpace(subscriptionName))
            {
                _logger.LogInformation("Received {Event} event from dead letter subqueue of {Queue} queue - raw data {RawData}", "unknown", queueOrTopicName, message?.ToString()?.Replace(Environment.NewLine, string.Empty));
            }
            else
            {
                _logger.LogInformation("Received {Event} event from dead letter subqueue of {Topic}/{Subscription} topic/subscription - raw data {RawData}", "unknown", queueOrTopicName, subscriptionName, message?.ToString()?.Replace(Environment.NewLine, string.Empty));
            }

            await _serviceBusPublisher.SendMessage(queueOrTopicName, ServiceBusMessage <object> .FromObject(message), CancellationToken.None);
        }