private async Task ProcessMessageAsync(SQSEvent.SQSMessage message, Boolean liveInstance) { String bucket; String file; try { message.MessageAttributes.TryGetValue("Bucket", out MessageAttribute messageBucket); message.MessageAttributes.TryGetValue("Object", out MessageAttribute messageObject); bucket = messageBucket.StringValue; file = messageObject.StringValue; } catch { //Test Code bucket = "nnc.incoming.emails.test"; //bucket = "norbert.emails.test"; //bucket = "nnc.emails.test"; file = "l9bot4j59quhc4jgpe67p0tnoojm2h6ghepi6781"; } ProcessMessage messageProcessor = new ProcessMessage(); messageProcessor.Process(bucket, file, liveInstance); await Task.CompletedTask; }
/// <inheritdoc /> protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _logger.LogInformation("Daemon is running ExecuteAsync."); _logger.LogDebug("Extra debug logging is shown."); _messageHandling.HandleMessages(ProcessMessage.Process(_now.Now, _guid.GetGuid)); await Task.CompletedTask; }