//JUST FOR DEBUGGING - REMOVE IN PRODUCTION private void DeleteAllQueues() { var allQueueNames = TopicQueues.AllTopicQueues().ToList(); foreach (var manageQueue in _manageClient.GetQueues()) { if (allQueueNames.Contains(manageQueue.Name)) { DeleteQueue(_topicExchange, manageQueue.Name, false); } else if (manageQueue.Name.StartsWith(TopicQueues.ProductEntitiesListPrefix) || manageQueue.Name.StartsWith(TopicQueues.ProductEntitiesUpdatedPrefix)) { DeleteQueue(_topicExchange, manageQueue.Name, false); } } }
private void InitialiseTopicQueues() { foreach (var queueName in TopicQueues.AllTopicQueues()) { IQueue queue = null; lock (_locker) { //Create queues (if they don't exist) and bind to queues queue = _advancedBus.QueueDeclare(queueName, false, true); _advancedBus.Bind(_topicExchange, queue, queueName); } //Add to our cached queues _cachedQueues.TryAdd(queue, 0); } }