Exemplo n.º 1
0
        public async Task RunAsync(
            [TimerTrigger("%TimerInterval%")] TimerInfo timer,
            [ServiceBus("%ContractEventsSessionQueue%", Connection = "ServiceBusConnection")] IAsyncCollector <Message> queueOutput,
            ILogger log)
        {
            log?.LogInformation($"C# Timer trigger function {nameof(FcsContractEventFeedReaderTimerFunction)} executed at: {DateTime.Now}");

            await _feedProcessor.ExtractAndPopulateQueueAsync(queueOutput);

            log?.LogInformation($"C# Timer trigger function {nameof(FcsContractEventFeedReaderTimerFunction)} Completed at: {DateTime.Now}");
        }
Exemplo n.º 2
0
        public async Task RunAsync(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = "feed")] HttpRequest req,
            [ServiceBus("%ContractEventsSessionQueue%", Connection = "ServiceBusConnection")] IAsyncCollector <Message> queueOutput,
            ILogger log)
        {
            using var reader = new StreamReader(req.Body);
            var payload = reader.ReadToEnd();

            log?.LogInformation($"HttpRequest trigger: FCSAtomFeedProcessorFunctionHttpFunction function.");

            await _feedProcessor.ExtractAndPopulateQueueAsync(payload, queueOutput);

            log?.LogInformation($"HttpRequest trigger: FCSAtomFeedProcessorFunction: function completed creating messages.");
        }