static void Main(string[] args) { var _client = SqsClientFactory.GetClient(); try { var response = _client.SendMessage(SqsConfigHelper.Config.QueueUrl, $"Hello {DateTime.Now}"); Console.WriteLine(response.HttpStatusCode); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadKey(); }
static void Main(string[] args) { var _client = SqsClientFactory.GetClient(); try { var request = new ReceiveMessageRequest(SqsConfigHelper.Config.QueueUrl) { MaxNumberOfMessages = 10, WaitTimeSeconds = 20 }; var response = _client.ReceiveMessage(request); response.Messages.ForEach(x => Console.WriteLine(x.Body)); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadKey(); }