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); } }
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); } }
public async Task CreateQueues() { var state = new State(); IEndpointInstance endpoint = null; try { await CreateEndpointQueues.CreateQueuesForEndpoint(endpointName, includeRetries : true) .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( queueName : errorQueueName) .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( queueName : auditQueueName) .ConfigureAwait(false); endpoint = await StartEndpoint(state).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); } } }
public void CreateQueuesForEndpointWithLongEndpointNameThrowsAndNoQueuesAreCreated() { // Below is 76 chars - this is fine for the main queue but too long for the retries, timeouts or dispatcher queues var endpointName = "mycreatequeuesendpointwithaverylongnamethatwillhavequeuenamesthataretoolong"; var exception = Assert.ThrowsAsync <ArgumentException>(async() => { await CreateEndpointQueues.CreateQueuesForEndpoint(endpointName, includeRetries: true) .ConfigureAwait(false); }); Assert.IsTrue(exception.Message.Contains("is longer than 80 characters and therefore cannot be used to create an SQS queue.")); }
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); } }
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); } }
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); } }
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); } }
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); } }