當前位置: 首頁>>代碼示例>>Java>>正文


Java Channel.queueDelete方法代碼示例

本文整理匯總了Java中com.rabbitmq.client.Channel.queueDelete方法的典型用法代碼示例。如果您正苦於以下問題:Java Channel.queueDelete方法的具體用法?Java Channel.queueDelete怎麽用?Java Channel.queueDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.rabbitmq.client.Channel的用法示例。


在下文中一共展示了Channel.queueDelete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: stop

import com.rabbitmq.client.Channel; //導入方法依賴的package包/類
@Override
public synchronized boolean stop() {
    if (s_connection.isOpen()) {
        for (final String subscriberId : s_subscribers.keySet()) {
            final Ternary<String, Channel, EventSubscriber> subscriberDetails = s_subscribers.get(subscriberId);
            final Channel channel = subscriberDetails.second();
            try {
                channel.queueDelete(subscriberId);
                channel.abort();
            } catch (final IOException ioe) {
                s_logger.warn("Failed to delete queue: " + subscriberId + " on AMQP server due to " + ioe.getMessage());
            }
        }
    }

    closeConnection();
    return true;
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:19,代碼來源:RabbitMQEventBus.java

示例2: declareQueue

import com.rabbitmq.client.Channel; //導入方法依賴的package包/類
private void declareQueue(String queue) throws Exception {
  Channel channel = sender.get().createChannel();
  try {
    channel.queueDelete(queue);
    channel.queueDeclare(queue, false, true, true, null);
  } finally {
    channel.close();
  }
  Thread.sleep(500L);
}
 
開發者ID:openzipkin,項目名稱:zipkin-reporter-java,代碼行數:11,代碼來源:RabbitMQSenderTest.java

示例3: declareQueue

import com.rabbitmq.client.Channel; //導入方法依賴的package包/類
/**
 * 當重複聲明同一名稱隊列時:
 * 1、參數相同,"不作為"
 * 2、參數不同,錯誤碼406
 * @throws IOException
 */
@Override
public void declareQueue() throws IOException {
    Connection connection = connection(connectionFactory());
    Channel channel = connection.createChannel();
    try {
        channel.queueDeclare("demo1",true,false,false,null);
    }catch (IOException e){
        if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){
            channel = connection.createChannel();
            channel.queueDelete("demo1");
            channel.queueDeclare("demo1",false,false,false,null);
        }
    }
}
 
開發者ID:laidu,項目名稱:java-learn,代碼行數:21,代碼來源:RabbitmqClientDemo.java


注:本文中的com.rabbitmq.client.Channel.queueDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。