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


Java BrokerService.setBrokerId方法代码示例

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


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

示例1: EmbeddedActiveMQBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public EmbeddedActiveMQBroker(String brokerId) {
    if ((brokerId == null) || (brokerId.isEmpty())) {
        throw new IllegalArgumentException("brokerId is empty");
    }
    this.brokerId = brokerId;
    tcpConnectorUri = "tcp://localhost:" + AvailablePortFinder.getNextAvailable();

    brokerService = new BrokerService();
    brokerService.setBrokerId(brokerId);
    brokerService.setPersistent(false);
    brokerService.setUseJmx(false);
    try {
        brokerService.setPersistenceAdapter(new MemoryPersistenceAdapter());
        brokerService.addConnector(tcpConnectorUri);
    } catch (Exception e) {
        throw new RuntimeException("Problem creating brokerService", e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:EmbeddedActiveMQBroker.java

示例2: EmbeddedActiveMQBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public EmbeddedActiveMQBroker(String brokerId) {
    Validate.notEmpty(brokerId, "brokerId is empty");
    this.brokerId = brokerId;
    tcpConnectorUri = "tcp://localhost:" + AvailablePortFinder.getNextAvailable();

    brokerService = new BrokerService();
    brokerService.setBrokerId(brokerId);
    brokerService.setPersistent(false);
    brokerService.setUseJmx(false);
    try {
        brokerService.setPersistenceAdapter(new MemoryPersistenceAdapter());
        brokerService.addConnector(tcpConnectorUri);
    } catch (Exception e) {
        throw new RuntimeException("Problem creating brokerService", e);
    }
}
 
开发者ID:jkorab,项目名称:camel-devoxx,代码行数:17,代码来源:EmbeddedActiveMQBroker.java

示例3: setUp

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
   super.setAutoFail(true);
   super.setUp();
   BrokerService brokerA = createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=true&useJmx=false&deleteAllMessagesOnStartup=true"));
   brokerA.setBrokerId("BrokerA");
   BrokerService brokerB = createBroker(new URI("broker:(tcp://localhost:61617)/BrokerB?persistent=true&useJmx=false&deleteAllMessagesOnStartup=true"));
   brokerB.setBrokerId("BrokerB");
   NetworkConnector aTOb = bridgeBrokers(brokers.get("BrokerA").broker, brokers.get("BrokerB").broker, false, 2, true, true);
   aTOb.addStaticallyIncludedDestination(queue);
   NetworkConnector bTOa = bridgeBrokers(brokers.get("BrokerB").broker, brokers.get("BrokerA").broker, false, 2, true, true);
   bTOa.addStaticallyIncludedDestination(queue);

   startAllBrokers();
   waitForBridgeFormation();

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:AMQ2927Test.java

示例4: EmbeddedTcpBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public EmbeddedTcpBroker(String name, int number) throws Exception {
   brokerSvc = new BrokerService();

   synchronized (this.getClass()) {
      brokerNum = Next_broker_num;
      Next_broker_num++;
   }

   brokerName = name + number;
   brokerId = brokerName;

   brokerSvc.setBrokerName(brokerName);
   brokerSvc.setBrokerId(brokerId);

   brokerSvc.setPersistent(false);
   brokerSvc.setUseJmx(false);

   port = 60000 + (brokerNum * 10);

   tcpUrl = "tcp://127.0.0.1:" + Integer.toString(port);
   fullUrl = tcpUrl + "?jms.watchTopicAdvisories=false";

   brokerSvc.addConnector(tcpUrl);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:25,代码来源:RequestReplyToTopicViaThreeNetworkHopsTest.java

示例5: startBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public void startBroker() throws Exception {
    String brokerName = "test-broker-" + System.currentTimeMillis();
    String brokerUri = "vm://" + brokerName;
    broker = new BrokerService();
    broker.setBrokerName(brokerName);
    broker.setBrokerId(brokerName);
    broker.addConnector(brokerUri);
    broker.setPersistent(false);
    // This Broker Plugin simulates Producer Flow Control by delaying the broker's ACK by 2 seconds
    broker.setPlugins(new BrokerPlugin[] {new DelayerBrokerPlugin()});
    broker.start();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:JmsBlockedAsyncRoutingEngineTest.java

示例6: restartBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected void restartBroker(String brokerName) throws Exception {
   destroyBroker("BrokerA");
   BrokerService broker = createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=true&useJmx=false"));
   broker.setBrokerId("BrokerA");
   NetworkConnector aTOb = bridgeBrokers(brokers.get("BrokerA").broker, brokers.get("BrokerB").broker, false, 2, true, true);
   aTOb.addStaticallyIncludedDestination(queue);
   broker.start();
   broker.waitUntilStarted();
   waitForBridgeFormation();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:AMQ2927Test.java

示例7: configureBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
public void configureBroker(BrokerService brokerService) {
   brokerService.setBrokerId(brokerService.getBrokerName());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:ThreeBrokerQueueNetworkTest.java

示例8: configureBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected void configureBroker(BrokerService broker) {
   broker.setBrokerId(broker.getBrokerName());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:ThreeBrokerTopicNetworkTest.java


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