/// <summary> /// Helper method for testing. Clears all messages in all the queues used by the specified stream provider. /// </summary> /// <param name="loggerFactory">logger factory to use</param> /// <param name="azureQueueNames">The deployment ID hosting the stream provider.</param> /// <param name="storageConnectionString">The azure storage connection string.</param> public static async Task ClearAllUsedAzureQueues(ILoggerFactory loggerFactory, List <string> azureQueueNames, string storageConnectionString) { var deleteTasks = new List <Task>(); foreach (var queueName in azureQueueNames) { var manager = new AzureQueueDataManager(loggerFactory, queueName, storageConnectionString); deleteTasks.Add(manager.ClearQueue()); } await Task.WhenAll(deleteTasks); }
/// <summary> /// Helper method for testing. Clears all messages in all the queues used by the specifed stream provider. /// </summary> /// <param name="providerName">The Azure Queue stream privider name.</param> /// <param name="deploymentId">The deployment ID hosting the stream provider.</param> /// <param name="storageConnectionString">The azure storage connection string.</param> public static async Task ClearAllUsedAzureQueues(string providerName, string deploymentId, string storageConnectionString) { if (deploymentId != null) { var queueMapper = new HashRingBasedStreamQueueMapper(AzureQueueAdapterConstants.NumQueuesDefaultValue, providerName); List <QueueId> allQueues = queueMapper.GetAllQueues().ToList(); var deleteTasks = new List <Task>(); foreach (var queueId in allQueues) { var manager = new AzureQueueDataManager(queueId.ToString(), deploymentId, storageConnectionString); deleteTasks.Add(manager.ClearQueue()); } await Task.WhenAll(deleteTasks); } }
/// <summary> /// Helper method for testing. Clears all messages in all the queues used by the specifed stream provider. /// </summary> /// <param name="loggerFactory">logger factory to use</param> /// <param name="providerName">The Azure Queue stream privider name.</param> /// <param name="deploymentId">The deployment ID hosting the stream provider.</param> /// <param name="storageConnectionString">The azure storage connection string.</param> public static async Task ClearAllUsedAzureQueues(ILoggerFactory loggerFactory, string providerName, string deploymentId, string storageConnectionString) { if (deploymentId != null) { // TODO: Do not assume defaults !? - jbragg var queueMapper = new HashRingBasedStreamQueueMapper(new HashRingStreamQueueMapperOptions(), providerName); List <QueueId> allQueues = queueMapper.GetAllQueues().ToList(); var deleteTasks = new List <Task>(); foreach (var queueId in allQueues) { var manager = new AzureQueueDataManager(loggerFactory, queueId.ToString(), deploymentId, storageConnectionString); deleteTasks.Add(manager.ClearQueue()); } await Task.WhenAll(deleteTasks); } }