Esempio n. 1
0
        private AmazonWebServiceResponse SendMessages(SendMessageBatchRequestWrapper sendMessageBatchRequest)
        {
            if (!_validatedQueueNames.ContainsKey(sendMessageBatchRequest.QueueName))
            {
                lock (_lockObject)
                {
                    if (!_validatedQueueNames.ContainsKey(sendMessageBatchRequest.QueueName))
                    {
                        var response = Client.CreateQueue(sendMessageBatchRequest.QueueName);
                        _validatedQueueNames.TryAdd(sendMessageBatchRequest.QueueName, response.QueueUrl);
                    }
                }
            }

            lock (_lockObject)
            {
                string queueUrl;
                _validatedQueueNames.TryGetValue(sendMessageBatchRequest.QueueName, out queueUrl);

                var messageBatchRequest = sendMessageBatchRequest.BatchRequest;
                messageBatchRequest.QueueUrl = queueUrl;
                var sendMessageBatchResponse = Client.SendMessageBatch(messageBatchRequest);
                return(sendMessageBatchResponse);
            }
        }
Esempio n. 2
0
 internal void AddSendMessageRequest(SendMessageBatchRequestWrapper sendMessageRequest)
 {
     AddRequest(() => SendMessages(sendMessageRequest));
 }