public void AfterAllTests() { var notAsyncQueue = GetQueue(QueueNameSync); if (notAsyncQueue != null) { _managementClient.DeleteQueue(notAsyncQueue); } var asyncQueue = GetQueue(QueueNameAsync); if (asyncQueue != null) { _managementClient.DeleteQueue(asyncQueue); } var exchange = GetExchange(ExchangeName); if (exchange != null) { _managementClient.DeleteExchange(exchange); } // Needed or tests were hanging. var bus = _container.GetInstance <IBus>(); bus.Advanced.Dispose(); }
public void Should_be_able_to_delete_a_queue() { var queue = managementClient.GetQueues().SingleOrDefault(x => x.Name == testQueue); if (queue == null) { throw new ApplicationException("Test queue has not been created"); } managementClient.DeleteQueue(queue); }
protected internal override void Apply(IManagementClient managementClient) { _log.Info($"Deleting queue '{Name}' from '{VirtualHost}'"); var virtualHost = managementClient.GetVhost(VirtualHost); var queue = managementClient.GetQueue(Name, virtualHost); managementClient.DeleteQueue(queue); _log.Info($"Finished deleting queue '{Name}' from '{VirtualHost}'"); }
public void CleanUp(IManagementClient client) { foreach (var queue in client.GetQueues()) { Console.Out.WriteLine("Deleting Queue: {0}", queue.Name); client.DeleteQueue(queue); } foreach (var exchange in client.GetExchanges()) { if (!exchange.Name.StartsWith("amp.")) { Console.Out.WriteLine("Deleting Exchange: {0}", exchange.Name); client.DeleteExchange(exchange); } } }
public async Task DeleteQueue(string queuePath) { await _managementClient.DeleteQueue(queuePath); }