Esempio n. 1
0
        /// <summary>
        /// Method (or it could be part of an external library/project) that contains the logic of the dequeue function.
        /// </summary>
        private static async Task DoDequeue(BrokeredMessage message, IAsyncCollector <MessageTrackingInfo> cosmosCollector, TraceWriter log, [CallerMemberName] string functionName = null)
        {
            log.Info($"C# ServiceBus queue trigger function named: {functionName}, processed message: {message.GetBody<string>()}");

            var trackingInfo = new MessageTrackingInfo()
            {
                Id      = message.MessageId,
                Payload = message.GetBody <string>()
            };

            await cosmosCollector.AddAsync(trackingInfo);
        }
        public async Task ProcessAsync()
        {
            _log.Info($"C# ServiceBus queue trigger function named: {_functionName}, processed message: {_message.GetBody<string>()}");

            var trackingInfo = new MessageTrackingInfo()
            {
                Id      = _message.MessageId,
                Payload = _message.GetBody <string>()
            };

            await _cosmosCollector.AddAsync(trackingInfo);
        }