當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。