Example usage for com.rabbitmq.client Channel queueDelete

List of usage examples for com.rabbitmq.client Channel queueDelete

Introduction

In this page you can find the example usage for com.rabbitmq.client Channel queueDelete.

Prototype

Queue.DeleteOk queueDelete(String queue) throws IOException;

Source Link

Document

Delete a queue, without regard for whether it is in use or has messages on it

Usage

From source file:zipkin2.collector.rabbitmq.ITRabbitMQCollector.java

License:Apache License

/** See GitHub issue #2068 */
@Test//  w  w  w  .  j  a  va  2s .  com
public void startsWhenConfiguredQueueAlreadyExists() throws IOException, TimeoutException {
    Channel channel = rabbit.collector.connection.get().createChannel();
    // make a queue with non-default properties
    channel.queueDeclare("zipkin-test2", true, false, false,
            Collections.singletonMap("x-message-ttl", 36000000));
    try {
        RabbitMQCollector.builder().storage(InMemoryStorage.newBuilder().build())
                .metrics(CollectorMetrics.NOOP_METRICS).queue("zipkin-test2")
                .addresses(Collections.singletonList(rabbit.address())).build().start().close();
    } finally {
        channel.queueDelete("zipkin-test2");
        channel.close();
    }
}

From source file:zipkin2.reporter.amqp.RabbitMQSenderTest.java

License:Apache License

private void declareQueue(String queue) throws Exception {
    Channel channel = sender.get().createChannel();
    try {//from   w w w  .j a  v a 2 s  .c  o  m
        channel.queueDelete(queue);
        channel.queueDeclare(queue, false, true, true, null);
    } finally {
        channel.close();
    }
    Thread.sleep(500L);
}