コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }