Exemplo n.º 1
0
        public async Task CreateQueuesForEndpointDefaultMaxTTL(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"mycreatedefaultendpoint-{randomName}";
            var errorQueueName = $"mycreatedefaulterror-{randomName}";
            var auditQueueName = $"mycreatedefaultaudit-{randomName}";

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

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName)
                .ConfigureAwait(false);

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

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 2
0
        public async Task CreateQueuesForEndpointWithRetries()
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"mycreateprefixendpoint-{randomName}";
            var errorQueueName = $"mycreateprefixerror-{randomName}";
            var auditQueueName = $"mycreateprefixaudit-{randomName}";

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

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName)
                .ConfigureAwait(false);

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

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 3
0
        public async Task CreateQueues_Powershell(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"createqueues-powershell-{randomName}";
            var errorQueueName = $"createqueueserror-powershell-{randomName}";
            var auditQueueName = $"createqueuesaudit-powershell-{randomName}";

            var state = new State();
            IEndpointInstance endpoint = null;

            try
            {
                var scriptPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.ps1");
                using (var powerShell = PowerShell.Create())
                {
                    powerShell.AddScript(File.ReadAllText(scriptPath));
                    powerShell.Invoke();
                    var command = powerShell.AddCommand("CreateQueuesForEndpoint");
                    command.AddParameter("EndpointName", endpointName);
                    command.AddParameter("IncludeRetries");
                    command.AddParameter("DelayedDeliveryMethod", delayedDeliveryMethod);
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", errorQueueName);
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", auditQueueName);
                    command.Invoke();
                }

                endpoint = await StartEndpoint(state, endpointName, errorQueueName, auditQueueName, delayedDeliveryMethod).ConfigureAwait(false);

                var messageToSend = new MessageToSend();
                await endpoint.SendLocal(messageToSend).ConfigureAwait(false);

                Assert.IsTrue(await state.Signal.Task.ConfigureAwait(false));
            }
            finally
            {
                if (endpoint != null)
                {
                    await endpoint.Stop().ConfigureAwait(false);
                }

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true, delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 4
0
 public void Setup()
 {
     SqlHelper.EnsureDatabaseExists(connectionString);
     using (var connection = new SqlConnection(connectionString))
     {
         connection.Open();
         DeleteEndpointQueues.DeleteQueuesForEndpoint(connection, schema, endpointName);
         DeleteEndpointQueues.DeleteQueuesForEndpoint(connection, schema, errorQueueName);
     }
 }
Exemplo n.º 5
0
        public async Task CreateQueuesForEndpointWithOverridenMaxTTL_Powershell()
        {
            var maxTimeToLive  = TimeSpan.FromDays(1);
            var endpointName   = "mycreateendpoint-powershell";
            var errorQueueName = "mycreateerror-powershell";
            var auditQueueName = "mycreateaudit-powershell";

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

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

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

            try
            {
                var scriptPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.ps1");
                using (var powerShell = PowerShell.Create())
                {
                    powerShell.AddScript(File.ReadAllText(scriptPath));
                    powerShell.Invoke();
                    var command = powerShell.AddCommand("CreateQueuesForEndpoint");
                    command.AddParameter("EndpointName", endpointName);
                    command.AddParameter("MaxTimeToLive", maxTimeToLive.ToString("G", CultureInfo.InvariantCulture));
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", errorQueueName);
                    command.AddParameter("MaxTimeToLive", maxTimeToLive.ToString("G", CultureInfo.InvariantCulture));
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", auditQueueName);
                    command.AddParameter("MaxTimeToLive", maxTimeToLive.ToString("G", CultureInfo.InvariantCulture));
                    command.Invoke();
                }

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, maxTimeToLive)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 6
0
        public async Task CreateQueuesForEndpointWithPrefix_Powershell()
        {
            var endpointName   = "mycreateprefixendpoint-powershell";
            var errorQueueName = "mycreateprefixerror-powershell";
            var auditQueueName = "mycreateprefixaudit-powershell";

            await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            await QueueDeletionUtils.DeleteQueue(errorQueueName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            await QueueDeletionUtils.DeleteQueue(auditQueueName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            try
            {
                var scriptPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.ps1");
                using (var powerShell = PowerShell.Create())
                {
                    powerShell.AddScript(File.ReadAllText(scriptPath));
                    powerShell.Invoke();
                    var command = powerShell.AddCommand("CreateQueuesForEndpoint");
                    command.AddParameter("EndpointName", endpointName);
                    command.AddParameter("QueueNamePrefix", "DEV");
                    command.AddParameter("IncludeRetries");
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", errorQueueName);
                    command.AddParameter("QueueNamePrefix", "DEV");
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", auditQueueName);
                    command.AddParameter("QueueNamePrefix", "DEV");
                    command.Invoke();
                }

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), queueNamePrefix : "DEV")
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(errorQueueName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(auditQueueName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 7
0
        public async Task SendLargePowerShell()
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"sendlargepowershell-{randomName}";
            var errorQueueName = $"sendlargepowershell-{randomName}-error";

            var state = new State();
            IEndpointInstance endpoint = null;

            try
            {
                endpoint = await StartEndpoint(state, endpointName, errorQueueName).ConfigureAwait(false);

                var message = @"{ Property: 'Value' }";

                var headers = new Dictionary <string, string>
                {
                    { "NServiceBus.EnclosedMessageTypes", typeof(MessageToSend).FullName },
                    { "NServiceBus.MessageId", Guid.NewGuid().ToString() }
                };

                var scriptPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"NativeSend\NativeSend.ps1");
                using (var powerShell = PowerShell.Create())
                {
                    powerShell.AddScript(File.ReadAllText(scriptPath));
                    powerShell.Invoke();
                    var command = powerShell.AddCommand("SendLargeMessage");
                    command.AddParameter("QueueName", endpointName);
                    command.AddParameter("S3Prefix", "test");
                    command.AddParameter("BucketName", SqsTransportConfigurationExtensions.S3BucketName);
                    command.AddParameter("MessageBody", message);
                    command.AddParameter("Headers", headers);
                    command.Invoke();
                }

                Assert.AreEqual("Value", await state.Signal.Task.ConfigureAwait(false));
            }
            finally
            {
                if (endpoint != null)
                {
                    await endpoint.Stop().ConfigureAwait(false);
                }

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true)
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 8
0
        public async Task Setup()
        {
            using (var connection = new SqlConnection(connectionString))
            {
                await connection.OpenAsync()
                .ConfigureAwait(false);

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(connection, schema, endpointName)
                .ConfigureAwait(false);

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(connection, schema, errorQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 9
0
        public async Task CreateQueuesForEndpointWithOverridenMaxTTL()
        {
            var maxTimeToLive  = TimeSpan.FromDays(1);
            var endpointName   = "mycreateendpoint";
            var errorQueueName = "mycreateerror";
            var auditQueueName = "mycreateaudit";

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

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

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

            try
            {
                await CreateEndpointQueues.CreateQueuesForEndpoint(
                    endpointName : endpointName,
                    maxTimeToLive : maxTimeToLive)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName,
                    maxTimeToLive : maxTimeToLive)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName,
                    maxTimeToLive : maxTimeToLive)
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, maxTimeToLive)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 10
0
        public async Task CreateQueues(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"createqueues-{randomName}";
            var errorQueueName = $"createqueues-{randomName}-error";
            var auditQueueName = $"createqueues-{randomName}-audit";

            var state = new State();
            IEndpointInstance endpoint = null;

            try
            {
                await CreateEndpointQueues.CreateQueuesForEndpoint(endpointName, includeRetries : true, delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName)
                .ConfigureAwait(false);

                endpoint = await StartEndpoint(state, endpointName, errorQueueName, auditQueueName, delayedDeliveryMethod).ConfigureAwait(false);

                var messageToSend = new MessageToSend();
                await endpoint.SendLocal(messageToSend).ConfigureAwait(false);

                Assert.IsTrue(await state.Signal.Task.ConfigureAwait(false));
            }
            finally
            {
                if (endpoint != null)
                {
                    await endpoint.Stop().ConfigureAwait(false);
                }

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true, delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 11
0
        public async Task CreateQueuesForEndpointWithPrefix()
        {
            var endpointName   = "mycreateprefixendpoint";
            var errorQueueName = "mycreateprefixerror";
            var auditQueueName = "mycreateprefixaudit";

            await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            await QueueDeletionUtils.DeleteQueue(errorQueueName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            await QueueDeletionUtils.DeleteQueue(auditQueueName, queueNamePrefix : "DEV")
            .ConfigureAwait(false);

            try
            {
                await CreateEndpointQueues.CreateQueuesForEndpoint(endpointName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName,
                    queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName,
                    queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), queueNamePrefix : "DEV")
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(errorQueueName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(auditQueueName, queueNamePrefix : "DEV")
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 12
0
        public async Task SendLarge()
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"sendlarge-{randomName}";
            var errorQueueName = $"sendlarge-{randomName}-error";

            var state = new State();
            IEndpointInstance endpoint = null;

            try
            {
                endpoint = await StartEndpoint(state, endpointName, errorQueueName).ConfigureAwait(false);

                var message = @"{ Property: 'Value' }";

                var headers = new Dictionary <string, string>
                {
                    { "NServiceBus.EnclosedMessageTypes", typeof(MessageToSend).FullName },
                    { "NServiceBus.MessageId", Guid.NewGuid().ToString() }
                };

                using (var s3Client = ClientFactory.CreateS3Client())
                    using (var client = ClientFactory.CreateSqsClient())
                    {
                        await NativeSend.SendLargeMessage(client, s3Client, endpointName, "test", SqsTransportConfigurationExtensions.S3BucketName, message, headers)
                        .ConfigureAwait(false);
                    }

                Assert.AreEqual("Value", await state.Signal.Task.ConfigureAwait(false));
            }
            finally
            {
                if (endpoint != null)
                {
                    await endpoint.Stop().ConfigureAwait(false);
                }

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true)
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 13
0
        public async Task CreateQueuesForEndpointDefaultMaxTTL_Powershell(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"mycreatedefaultendpoint-{randomName}-powershell";
            var errorQueueName = $"mycreatedefaulterror-{randomName}-powershell";
            var auditQueueName = $"mycreatedefaultaudit-{randomName}-powershell";

            try
            {
                var scriptPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.ps1");
                using (var powerShell = PowerShell.Create())
                {
                    powerShell.AddScript(File.ReadAllText(scriptPath));
                    powerShell.Invoke();
                    var command = powerShell.AddCommand("CreateQueuesForEndpoint");
                    command.AddParameter("EndpointName", endpointName);
                    command.AddParameter("DelayedDeliveryMethod", delayedDeliveryMethod);
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", errorQueueName);
                    command.Invoke();

                    command = powerShell.AddCommand("CreateQueue");
                    command.AddParameter("QueueName", auditQueueName);
                    command.Invoke();
                }

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

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 14
0
        public async Task CreateQueuesForEndpointWithRetries()
        {
            var endpointName   = "mycreateretriesendpoint";
            var errorQueueName = "mycreateretrieserror";
            var auditQueueName = "mycreateretriesaudit";

            await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true)
            .ConfigureAwait(false);

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

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

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

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName)
                .ConfigureAwait(false);

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

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 15
0
        public async Task CreateQueuesForEndpointDefaultMaxTTL()
        {
            var endpointName   = "mycreatedefaultendpoint";
            var errorQueueName = "mycreatedefaulterror";
            var auditQueueName = "mycreatedefaultaudit";

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

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

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

            try
            {
                await CreateEndpointQueues.CreateQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : errorQueueName)
                .ConfigureAwait(false);

                await QueueCreationUtils.CreateQueue(
                    queueName : auditQueueName)
                .ConfigureAwait(false);

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

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

                await QueueDeletionUtils.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 16
0
        public async Task ReturnMessageToSourceQueue()
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"returnmessagetosourcequeue-{randomName}";
            var errorQueueName = $"returnmessagetosourcequeue-{randomName}-error";

            var state = new State();
            IEndpointInstance endpoint = null;

            try
            {
                endpoint = await StartEndpoint(state, endpointName, errorQueueName).ConfigureAwait(false);

                var messageToSend = new MessageToSend();
                await endpoint.SendLocal(messageToSend).ConfigureAwait(false);

                var messageId = await GetMessageId(errorQueueName).ConfigureAwait(false);

                state.ShouldHandlerThrow = false;

                await ErrorQueue.ReturnMessageToSourceQueue(
                    errorQueueName : errorQueueName,
                    messageId : messageId)
                .ConfigureAwait(false);

                Assert.IsTrue(await state.Signal.Task.ConfigureAwait(false));
            }
            finally
            {
                if (endpoint != null)
                {
                    await endpoint.Stop().ConfigureAwait(false);
                }

                await DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName, includeRetries : true)
                .ConfigureAwait(false);

                await QueueDeletionUtils.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);
            }
        }
 public void Setup()
 {
     DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName);
 }
Exemplo n.º 18
0
 public void Setup()
 {
     DeleteEndpointQueues.DeleteQueuesForEndpoint(endpointName);
     QueueDeletionUtils.DeleteQueue(errorQueueName);
 }
Exemplo n.º 19
0
 public void Setup()
 {
     DeleteEndpointQueues.DeleteQueuesForEndpoint("amqp://*****:*****@localhost:5672", endpointName);
     DeleteEndpointQueues.DeleteQueuesForEndpoint("amqp://*****:*****@localhost:5672", errorQueueName);
 }
Exemplo n.º 20
0
 public void Setup()
 {
     DeleteEndpointQueues.DeleteQueuesForEndpoint(QueueNameHelper.GetSqsQueueName(endpointName)).GetAwaiter().GetResult();
     QueueDeletionUtils.DeleteQueue(QueueNameHelper.GetSqsQueueName(errorQueueName)).GetAwaiter().GetResult();
 }
Exemplo n.º 21
0
 public void Setup()
 {
     DeleteEndpointQueues.DeleteQueuesForEndpoint("myendpoint");
     QueueDeletionUtils.DeleteQueue("myerror");
     QueueDeletionUtils.DeleteQueue("myaudit");
 }