本文整理匯總了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);
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}