本文整理汇总了Java中org.apache.activemq.broker.BrokerService.setEnableStatistics方法的典型用法代码示例。如果您正苦于以下问题:Java BrokerService.setEnableStatistics方法的具体用法?Java BrokerService.setEnableStatistics怎么用?Java BrokerService.setEnableStatistics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.broker.BrokerService
的用法示例。
在下文中一共展示了BrokerService.setEnableStatistics方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureBroker
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected void configureBroker(BrokerService answer) throws Exception {
File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
KahaDBPersistenceAdapter kaha = new KahaDBPersistenceAdapter();
kaha.setDirectory(dataFileDir);
//answer.setUseJmx(false);
// The setEnableJournalDiskSyncs(false) setting is a little dangerous right now, as I have not verified
// what happens if the index is updated but a journal update is lost.
// Index is going to be in consistent, but can it be repaired?
//kaha.setEnableJournalDiskSyncs(false);
// Using a bigger journal file size makes he take fewer spikes as it is not switching files as often.
//kaha.setJournalMaxFileLength(1024*100);
// small batch means more frequent and smaller writes
//kaha.setIndexWriteBatchSize(100);
// do the index write in a separate thread
//kaha.setEnableIndexWriteAsync(true);
answer.setPersistenceAdapter(kaha);
answer.setAdvisorySupport(false);
answer.setEnableStatistics(false);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
示例2: createBroker
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected BrokerService createBroker() throws Exception {
BrokerService brokerService = new BrokerService();
brokerService.setEnableStatistics(false);
brokerService.addConnector("tcp://0.0.0.0:0");
brokerService.setDeleteAllMessagesOnStartup(true);
PolicyEntry policy = new PolicyEntry();
policy.setPrioritizedMessages(true);
policy.setMaxPageSize(500);
PolicyMap policyMap = new PolicyMap();
policyMap.setDefaultEntry(policy);
brokerService.setDestinationPolicy(policyMap);
setDefaultPersistenceAdapter(brokerService);
return brokerService;
}
示例3: configureBroker
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected void configureBroker(BrokerService answer, String uri) throws Exception {
//AMQPersistenceAdapterFactory persistenceFactory = new AMQPersistenceAdapterFactory();
//persistenceFactory.setMaxFileLength(1024*16);
//persistenceFactory.setPersistentIndex(true);
//persistenceFactory.setCleanupInterval(10000);
//answer.setPersistenceFactory(persistenceFactory);
answer.setDeleteAllMessagesOnStartup(true);
answer.addConnector(uri);
answer.setUseShutdownHook(false);
answer.setEnableStatistics(false);
}
示例4: createBroker
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected BrokerService createBroker() throws Exception {
BrokerService brokerService = new BrokerService();
brokerService.setEnableStatistics(false);
brokerService.addConnector("tcp://0.0.0.0:0");
brokerService.setDeleteAllMessagesOnStartup(true);
PolicyEntry policy = new PolicyEntry();
policy.setPrioritizedMessages(true);
policy.setMaxPageSize(500);
StorePendingDurableSubscriberMessageStoragePolicy durableSubPending = new StorePendingDurableSubscriberMessageStoragePolicy();
durableSubPending.setImmediatePriorityDispatch(true);
durableSubPending.setUseCache(true);
policy.setPendingDurableSubscriberPolicy(durableSubPending);
PolicyMap policyMap = new PolicyMap();
policyMap.setDefaultEntry(policy);
brokerService.setDestinationPolicy(policyMap);
// if (false) {
// // external mysql works a lot faster
// //
// JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
// BasicDataSource ds = new BasicDataSource();
// com.mysql.jdbc.Driver d = new com.mysql.jdbc.Driver();
// ds.setDriverClassName("com.mysql.jdbc.Driver");
// ds.setUrl("jdbc:mysql://localhost/activemq?relaxAutoCommit=true");
// ds.setMaxActive(200);
// ds.setUsername("root");
// ds.setPassword("");
// ds.setPoolPreparedStatements(true);
// jdbc.setDataSource(ds);
// brokerService.setPersistenceAdapter(jdbc);
/* add mysql bits to the pom in the testing dependencies
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
*/
// } else {
setPersistenceAdapter(brokerService, persistenceAdapterChoice);
// }
return brokerService;
}