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


Java BrokerService.setManagementContext方法代码示例

本文整理汇总了Java中org.apache.activemq.broker.BrokerService.setManagementContext方法的典型用法代码示例。如果您正苦于以下问题:Java BrokerService.setManagementContext方法的具体用法?Java BrokerService.setManagementContext怎么用?Java BrokerService.setManagementContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.broker.BrokerService的用法示例。


在下文中一共展示了BrokerService.setManagementContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLocalBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private void createLocalBroker() throws Exception {
   localBroker = new BrokerService();
   localBroker.setBrokerName("LOCAL");
   localBroker.setUseJmx(true);
   localBroker.setSchedulePeriodForDestinationPurge(5000);
   ManagementContext managementContext = new ManagementContext();
   managementContext.setCreateConnector(false);
   localBroker.setManagementContext(managementContext);
   PersistenceAdapter persistenceAdapter = persistenceAdapterFactory("target/local");
   localBroker.setPersistenceAdapter(persistenceAdapter);
   List<TransportConnector> transportConnectors = new ArrayList<>();
   DebugTransportFactory tf = new DebugTransportFactory();
   TransportServer transport = tf.doBind(URI.create("nio://127.0.0.1:23539"));
   TransportConnector transportConnector = new TransportConnector(transport);
   transportConnector.setName("tc");
   transportConnector.setAuditNetworkProducers(true);
   transportConnectors.add(transportConnector);
   localBroker.setTransportConnectors(transportConnectors);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:20,代码来源:CheckDuplicateMessagesOnDuplexTest.java

示例2: createRemoteBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private void createRemoteBroker() throws Exception {
   remoteBroker = new BrokerService();
   remoteBroker.setBrokerName("REMOTE");
   remoteBroker.setUseJmx(true);
   remoteBroker.setSchedulePeriodForDestinationPurge(5000);
   ManagementContext managementContext = new ManagementContext();
   managementContext.setCreateConnector(false);
   remoteBroker.setManagementContext(managementContext);
   PersistenceAdapter persistenceAdapter = persistenceAdapterFactory("target/remote");
   remoteBroker.setPersistenceAdapter(persistenceAdapter);
   List<NetworkConnector> networkConnectors = new ArrayList<>();
   DiscoveryNetworkConnector networkConnector = new DiscoveryNetworkConnector();
   networkConnector.setName("to local");
   // set maxInactivityDuration to 0, otherwise the broker restarts while you are in the debugger
   networkConnector.setUri(URI.create("static://(tcp://127.0.0.1:23539?wireFormat.maxInactivityDuration=0)"));
   networkConnector.setDuplex(true);
   //networkConnector.setNetworkTTL(5);
   //networkConnector.setDynamicOnly(true);
   networkConnector.setAlwaysSyncSend(true);
   networkConnector.setDecreaseNetworkConsumerPriority(false);
   networkConnector.setPrefetchSize(1);
   networkConnector.setCheckDuplicateMessagesOnDuplex(true);
   networkConnectors.add(networkConnector);
   remoteBroker.setNetworkConnectors(networkConnectors);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:CheckDuplicateMessagesOnDuplexTest.java

示例3: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected BrokerService createBroker() throws Exception {
   BrokerService answer = new BrokerService();
   answer.setPersistent(isPersistent());
   answer.addConnector(bindAddress);
   ManagementContext context = new ManagementContext();
   context.setConnectorPort(1199);
   answer.setManagementContext(context);
   return answer;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:AdvisoryJmxTest.java


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