當前位置: 首頁>>代碼示例>>Java>>正文


Java BrokerService.setUseJmx方法代碼示例

本文整理匯總了Java中org.apache.activemq.broker.BrokerService.setUseJmx方法的典型用法代碼示例。如果您正苦於以下問題:Java BrokerService.setUseJmx方法的具體用法?Java BrokerService.setUseJmx怎麽用?Java BrokerService.setUseJmx使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.activemq.broker.BrokerService的用法示例。


在下文中一共展示了BrokerService.setUseJmx方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Before
public void startBroker() throws Exception {
  broker = new BrokerService();
  broker.setUseJmx(false);
  broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
  broker.addConnector(BROKER_URL);
  broker.setBrokerName("localhost");
  broker.setPopulateJMSXUserID(true);
  broker.setUseAuthenticatedPrincipalForJMSXUserID(true);

  // enable authentication
  List<AuthenticationUser> users = new ArrayList<>();
  // username and password to use to connect to the broker.
  // This user has users privilege (able to browse, consume, produce, list destinations)
  users.add(new AuthenticationUser(USERNAME, PASSWORD, "users"));
  SimpleAuthenticationPlugin plugin = new SimpleAuthenticationPlugin(users);
  BrokerPlugin[] plugins = new BrokerPlugin[]{ plugin };
  broker.setPlugins(plugins);

  broker.start();

  // create JMS connection factory
  connectionFactory = new ActiveMQConnectionFactory(BROKER_URL);
  connectionFactoryWithoutPrefetch =
      new ActiveMQConnectionFactory(BROKER_URL + "?jms.prefetchPolicy.all=0");
}
 
開發者ID:apache,項目名稱:beam,代碼行數:27,代碼來源:JmsIOTest.java

示例2: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Before
@Override
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setUseJmx(false);
    brokerService.setAdvisorySupport(false);
    brokerService.setSchedulerSupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();
    connectionUri = connector.getPublishableConnectString();
    factory = new ActiveMQConnectionFactory(connectionUri);
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
    pooledFactory.setMaxConnections(1);
    pooledFactory.setBlockIfSessionPoolIsFull(false);
    pooledFactory.setMaximumActiveSessionPerConnection(1);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:21,代碼來源:PooledSessionExhaustionTest.java

示例3: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setUseJmx(false);
    brokerService.setAdvisorySupport(false);
    brokerService.setSchedulerSupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();

    connectionUri = connector.getPublishableConnectString();
    factory = new ActiveMQConnectionFactory(connectionUri);
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
    pooledFactory.setMaxConnections(1);
    pooledFactory.setBlockIfSessionPoolIsFull(false);
    pooledFactory.setUseAnonymousProducers(false);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:22,代碼來源:PooledSessionNoPublisherCachingTest.java

示例4: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setUseJmx(true);
    brokerService.getManagementContext().setCreateConnector(false);
    brokerService.setAdvisorySupport(false);
    brokerService.setSchedulerSupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();

    connectionUri = connector.getPublishableConnectString();
    factory = new ActiveMQConnectionFactory(connectionUri);
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
    pooledFactory.setMaxConnections(1);
    pooledFactory.setBlockIfSessionPoolIsFull(false);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:22,代碼來源:PooledSessionTest.java

示例5: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setUseJmx(false);
    brokerService.setSchedulerSupport(false);
    brokerService.setAdvisorySupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();

    connectionUri = connector.getPublishableConnectString();
    factory = new ActiveMQConnectionFactory(connectionUri);
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
    pooledFactory.setMaxConnections(1);
    pooledFactory.setBlockIfSessionPoolIsFull(true);
    pooledFactory.setBlockIfSessionPoolIsFullTimeout(500);
    pooledFactory.setMaximumActiveSessionPerConnection(1);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:22,代碼來源:PooledSessionExhaustionBlockTimeoutTest.java

示例6: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setUseJmx(false);
    brokerService.setPersistent(false);
    brokerService.setSchedulerSupport(false);
    brokerService.setAdvisorySupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();
    factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri() + "?closeAsync=false");
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:17,代碼來源:PooledConnectionFactoryWithTemporaryDestinationsTest.java

示例7: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
    super.setUp();

    brokerService = new BrokerService();
    brokerService.setUseJmx(false);
    brokerService.setPersistent(false);
    brokerService.setSchedulerSupport(false);
    brokerService.setAdvisorySupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
    brokerService.start();
    factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri());
    pooledFactory = new JmsPoolConnectionFactory();
    pooledFactory.setConnectionFactory(factory);
    pooledFactory.setMaxConnections(1);
}
 
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:18,代碼來源:PooledConnectionExpiryEvictsFromPoolTest.java

示例8: ServerSide

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
public ServerSide() {
    try {
        //This message broker is embedded
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);
        broker.setUseJmx(false);
        broker.addConnector(messageBrokerUrl);
        broker.start();
    } catch (Exception e) {
        //Handle the exception appropriately
    }
    QueueConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
    //Delegating the handling of messages to another class, instantiate it before setting up JMS so it
    //is ready to handle messages
    this.messageProtocol = new MessageProtocol();
    this.setupMessageQueueConsumer(connectionFactory);
}
 
開發者ID:mariaklimenko,項目名稱:jeta,代碼行數:18,代碼來源:ServerSide.java

示例9: initServerConfig

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
void initServerConfig(final MockedServerConfigDTO config) throws MockServerException {
    logger.debug("initServerConfig called");

    try {

        // Configure the MQ broker
        synchronized (monitor) {
            broker = new BrokerService();
            broker.setPersistent(false);
            broker.setUseJmx(false);
            broker.addConnector(config.getNativeProperties().get("BROKER_URL") + config.getPort());
        }

        connectionFactory = new ActiveMQConnectionFactory(config.getNativeProperties().get("BROKER_URL") + config.getPort());
        connectionFactory.setMaxThreadPoolSize(config.getMaxThreads());
        connectionFactory.setRejectedTaskHandler(new ThreadPoolExecutor.CallerRunsPolicy());

    } catch (Throwable ex) {
        throw new MockServerException(ex);
    }

}
 
開發者ID:mgtechsoftware,項目名稱:smockin,代碼行數:23,代碼來源:MockedJmsServerEngine.java

示例10: createBrokerService

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
private BrokerService createBrokerService(final String name) {
    final BrokerService broker = new BrokerService();
    broker.setPersistent(persistent);
    broker.setBrokerName(name);
    broker.setStartAsync(false);
    tempDir = Files.createTempDir();
    broker.setDataDirectoryFile(tempDir);
    try {
        broker.addConnector(createVmTransportServer(createVmTransportUri(name)));
    } catch (Exception e) {
        throw new IllegalStateException("Could not create VM Transport URI", e);
    }
    broker.setUseJmx(false);

    return broker;
}
 
開發者ID:zapodot,項目名稱:embedded-jms-junit,代碼行數:17,代碼來源:EmbeddedJmsRuleImpl.java

示例11: startMessagingSystem

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
private void startMessagingSystem()
{
    try
    {
        brokerService = new BrokerService();
        brokerService.addConnector(url+this.getApplicationPort2());
        brokerService.setPersistent(false);
        brokerService.setUseJmx(false);
        brokerService.setBrokerName("MithraTest"+this.getApplicationPort2());
        brokerService.setShutdownOnMasterFailure(false);
        brokerService.start();
    }
    catch(Exception e)
    {
       getLogger().error("Unable to start messaging broker");
       throw new RuntimeException("Exception during messaging broker startup", e);
    }
}
 
開發者ID:goldmansachs,項目名稱:reladomo,代碼行數:19,代碼來源:MultiVmNotificationsTestSuite.java

示例12: configureBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected void configureBroker(BrokerService broker) throws Exception {
    broker.setUseJmx(true);
    broker.setPersistent(true);
    broker.setDataDirectory("target/activemq-data");
    broker.deleteAllMessages();
    broker.setAdvisorySupport(true);
    broker.addConnector(brokerUri);

    // configure expiration rate
    ActiveMQQueue queueName = new ActiveMQQueue(">");
    PolicyEntry entry = new PolicyEntry();
    entry.setDestination(queueName);
    entry.setExpireMessagesPeriod(1000);

    PolicyMap policyMap = new PolicyMap();
    policyMap.put(queueName, entry);
    broker.setDestinationPolicy(policyMap);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:QueueProducerQoSTest.java

示例13: 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

示例14: setUp

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

   // Setup and start the broker
   broker = new BrokerService();
   broker.setBrokerName(brokerName);
   broker.setPersistent(false);
   broker.setSchedulerSupport(false);
   broker.setUseJmx(false);
   broker.setUseShutdownHook(false);
   broker.addConnector(brokerUrl);

   // Start the broker
   broker.start();
   broker.waitUntilStarted();
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:17,代碼來源:QueueOptimizedDispatchExceptionTest.java

示例15: createSecondRemoteBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected BrokerService createSecondRemoteBroker() throws Exception {
   secondRemoteBroker = new BrokerService();
   secondRemoteBroker.setBrokerName("secondRemotehost");
   secondRemoteBroker.setUseJmx(false);
   secondRemoteBroker.setPersistenceAdapter(null);
   secondRemoteBroker.setPersistent(false);
   secondRemoteConnector = createSecondRemoteConnector();
   secondRemoteBroker.addConnector(secondRemoteConnector);
   configureBroker(secondRemoteBroker);
   secondRemoteBroker.start();
   secondRemoteBroker.waitUntilStarted();

   brokers.put(secondRemoteBroker.getBrokerName(), secondRemoteBroker);

   return secondRemoteBroker;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:17,代碼來源:BrokerNetworkWithStuckMessagesTest.java


注:本文中的org.apache.activemq.broker.BrokerService.setUseJmx方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。