public async Task CreateQueuesForEndpointWithRetries_CloudFormation()
        {
            var endpointName              = "mycreateretriesendpoint-cloudformation";
            var errorQueueName            = "mycreateretriesendpointerror-cloudformation";
            var auditQueueName            = "mycreateretriesendpointaudit-cloudformation";
            var queueCreationTemplatePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.json");
            var endpointTemplatePath      = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/CreateEndpointQueues.json");

            await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
            .ConfigureAwait(false);

            await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
            .ConfigureAwait(false);

            await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
            .ConfigureAwait(false);

            try
            {
                await CreateEndpointQueuesCloudFormation.CreateQueuesForEndpoint(endpointName, endpointTemplatePath, includeRetries : true)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : errorQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : auditQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), includeRetries : true)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemple #2
0
        public async Task CreateQueuesForEndpointDefaultMaxTTL_CloudFormation(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"mycreatedefaultendpoint-cloudformation-{randomName}";
            var errorQueueName = $"mycreatedefaulterror-cloudformation-{randomName}";
            var auditQueueName = $"mycreatedefaultaudit-cloudformation-{randomName}";

            var queueCreationTemplatePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.json");
            var endpointTemplatePath      = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/CreateEndpointQueues.json");

            try
            {
                await CreateEndpointQueuesCloudFormation.CreateQueuesForEndpoint(endpointName, endpointTemplatePath, delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : errorQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : auditQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemple #3
0
        async Task Usage()
        {
            #region sqs-create-queues-shared-usage

            await QueueCreationUtils.CreateQueue(
                queueName : "error",
                maxTimeToLive : TimeSpan.FromDays(2),
                queueNamePrefix : "PROD")
            .ConfigureAwait(false);

            await QueueCreationUtils.CreateQueue(
                queueName : "audit",
                maxTimeToLive : TimeSpan.FromDays(2),
                queueNamePrefix : "PROD")
            .ConfigureAwait(false);

            #endregion

            #region sqs-create-queues-shared-usage-cloudformation

            await QueueCreationUtilsCloudFormation.CreateQueue(
                queueName : "error",
                templatePath : @".\QueueCreation.json",
                maxTimeToLive : TimeSpan.FromDays(2),
                queueNamePrefix : "PROD")
            .ConfigureAwait(false);

            await QueueCreationUtilsCloudFormation.CreateQueue(
                queueName : "audit",
                templatePath : @".\QueueCreation.json",
                maxTimeToLive : TimeSpan.FromDays(2),
                queueNamePrefix : "PROD")
            .ConfigureAwait(false);

            #endregion
        }