public static async Task MessageSendSummaryMessage(string message)
 {
     message  = "App started at: " + StartTime.ToLongDateString() + " " + StartTime.ToLongTimeString() + Environment.NewLine + message;
     message += "App ending at: " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + Environment.NewLine;
     System.Console.WriteLine(message);
     await AWS.SendMessage(SQSURL, message);
 }
Beispiel #2
0
        //https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/SendMessage.html
        // Method to put a message on a queue
        // Could be expanded to include message attributes, etc., in a SendMessageRequest
        public static async Task SendMessage(string qUrl, string messageBody)
        {
            IAmazonSQS          sqsClient       = AWS.GetAmazonSQSClient();
            SendMessageResponse responseSendMsg =
                await sqsClient.SendMessageAsync(qUrl, messageBody);

            Console.WriteLine($"Message added to queue\n  {qUrl}");
            Console.WriteLine($"HttpStatusCode: {responseSendMsg.HttpStatusCode}");
        }