当前位置: 首页>>代码示例>>Java>>正文


Java BrokerService.setEnableStatistics方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:NumberOfDestinationsTest.java

示例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;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:ConcurrentProducerQueueConsumerTest.java

示例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);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:KahaDBDurableTopicTest.java

示例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;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:54,代码来源:ConcurrentProducerDurableConsumerTest.java


注:本文中的org.apache.activemq.broker.BrokerService.setEnableStatistics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。