本文整理汇总了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);
}