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


Java BrokerService.deleteAllMessages方法代碼示例

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


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

示例1: configureBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected void configureBroker(BrokerService broker) throws Exception {
    broker.setUseJmx(true);
    broker.setPersistent(true);
    broker.setDataDirectory("target/activemq-data");
    broker.deleteAllMessages();
    broker.setAdvisorySupport(true);
    broker.addConnector(brokerUri);

    // configure expiration rate
    ActiveMQQueue queueName = new ActiveMQQueue(">");
    PolicyEntry entry = new PolicyEntry();
    entry.setDestination(queueName);
    entry.setExpireMessagesPeriod(1000);

    PolicyMap policyMap = new PolicyMap();
    policyMap.put(queueName, entry);
    broker.setDestinationPolicy(policyMap);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:QueueProducerQoSTest.java

示例2: createBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected BrokerService createBroker() throws Exception {
   BrokerService broker = new BrokerService();
   broker.getSystemUsage().getMemoryUsage().setLimit(1 * 1024 * 1024); //1MB
   broker.deleteAllMessages();

   PolicyMap policyMap = new PolicyMap();
   PolicyEntry policyEntry = new PolicyEntry();
   policyEntry.setProducerFlowControl(false);
   policyMap.put(new ActiveMQQueue(">"), policyEntry);
   broker.setDestinationPolicy(policyMap);

   LOG.info("Starting broker with persistenceAdapterChoice " + persistenceAdapterChoice.toString());
   setPersistenceAdapter(broker, persistenceAdapterChoice);
   broker.getPersistenceAdapter().deleteAllMessages();

   return broker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:18,代碼來源:MemoryLimitTest.java

示例3: beforeClass

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@BeforeClass
public static void beforeClass() throws Exception {
    Locale.setDefault(Locale.ENGLISH);

    // some dummy values
    AuditorModuleContext.getContext().getConfig().setAuditRepositoryHost("localhost");
    AuditorModuleContext.getContext().getConfig().setAuditRepositoryPort(514);

    jmsBroker = new BrokerService();
    jmsBroker.addConnector(JMS_BROKER_URL);
    jmsBroker.setUseJmx(false);
    jmsBroker.setPersistent(false);
    jmsBroker.deleteAllMessages();
    jmsBroker.start();
}
 
開發者ID:oehf,項目名稱:ipf-oht-atna,代碼行數:16,代碼來源:JmsAuditMessageQueueTest.java

示例4: startRemoteBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected void startRemoteBroker(boolean delete) throws Exception {
   remoteBroker = new BrokerService();
   remoteBroker.addConnector("tcp://localhost:61616");
   if (delete) {
      remoteBroker.deleteAllMessages();
   }
   remoteBroker.setUseJmx(false);
   remoteBroker.start();
   remoteBroker.waitUntilStarted();
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:11,代碼來源:ProxyFailoverTest.java

示例5: createBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected BrokerService createBroker() throws Exception {
   BrokerService broker = super.createBroker();
   broker.getSystemUsage().getStoreUsage().setLimit(10 * 1024);
   broker.deleteAllMessages();
   return broker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:8,代碼來源:StoreUsageTest.java

示例6: createBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected BrokerService createBroker() throws Exception {
   File schedulerDirectory = new File("target/scheduler");

   IOHelper.mkdirs(schedulerDirectory);
   IOHelper.deleteChildren(schedulerDirectory);

   BrokerService broker = super.createBroker();
   broker.setSchedulerSupport(true);
   broker.setSchedulerDirectoryFile(schedulerDirectory);
   broker.getSystemUsage().getJobSchedulerUsage().setLimit(7 * 1024);
   broker.deleteAllMessages();
   return broker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:15,代碼來源:JobSchedulerStoreUsageTest.java

示例7: createBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected BrokerService createBroker() throws Exception {
   BrokerService broker = super.createBroker();
   broker.getSystemUsage().getMemoryUsage().setLimit(Long.MAX_VALUE);
   broker.getSystemUsage().setCheckLimitsLogLevel(limitsLogLevel);
   broker.deleteAllMessages();
   return broker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:9,代碼來源:StoreUsageLimitsTest.java

示例8: createBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected BrokerService createBroker() throws Exception {
   File schedulerDirectory = new File("target/scheduler");

   IOHelper.mkdirs(schedulerDirectory);
   IOHelper.deleteChildren(schedulerDirectory);

   BrokerService broker = super.createBroker();
   broker.setSchedulerSupport(true);
   broker.setDataDirectory("target");
   broker.setSchedulerDirectoryFile(schedulerDirectory);
   broker.getSystemUsage().getStoreUsage().setLimit(1 * 512);
   broker.deleteAllMessages();
   return broker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:16,代碼來源:JobSchedulerBrokerShutdownTest.java

示例9: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected void setUp() throws Exception {
   super.setUp();
   broker = new BrokerService();
   broker.setPersistent(true);
   broker.setUseJmx(true);
   broker.deleteAllMessages();
   broker.addConnector("tcp://localhost:0");
   broker.start();
   broker.waitUntilStarted();
   dest = new ActiveMQQueue(destinationName);
   resetCounters();
   brokerURL = broker.getTransportConnectors().get(0).getPublishableConnectString();
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:15,代碼來源:DispatchMultipleConsumersTest.java

示例10: configureBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected void configureBroker(BrokerService broker) throws Exception {
    broker.setUseJmx(true);
    broker.setPersistent(false);
    broker.deleteAllMessages();
    broker.addConnector(brokerUri);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:7,代碼來源:JmsTestSupport.java


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