public AwsSqsClient(AwsSqsConfiguration awsSqsConfiguration)
        {
            this.awsSqsConfiguration = awsSqsConfiguration;

            // AmazonSQSClient _client = new AmazonSQSClient("ACCESSKEY", "ACCESSSECRET", config);
            amazonSQSClient = new AmazonSQSClient(awsSqsConfiguration.AmazonSQSConfig);
        }
示例#2
0
        public static void Main(string[] args)
        {
            var    qName  = "sachin_sqs";
            var    sqsUrl = "https://sqs.us-east-1.amazonaws.com";
            string sQueue = $"{sqsUrl}/315363577005/{qName}";
            var    awsSqsConfiguration = new AwsSqsConfiguration
            {
                AmazonSQSConfig = new AmazonSQSConfig()
                {
                    ServiceURL = sqsUrl
                },
                QueueURL = sQueue
            };
            var message = new TenantActionMessage()
            {
                TenantId   = Guid.NewGuid(),
                TenantName = "Test Action"
            };
            var awsSqsClient = new AwsSqsClient(awsSqsConfiguration);

            awsSqsClient.SendMessage(message);
            var receiptHandles = awsSqsClient.ReceiveMessage();

            receiptHandles.ForEach(receiptHandle => awsSqsClient.DeleteMessage(receiptHandle));
            // Console.Write(GetServiceOutput());
            Console.Read();
        }