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


Java TransportConnector.getPublishableConnectString方法代码示例

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


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

示例1: setUp

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的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

示例2: setUp

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的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

示例3: setUp

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的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

示例4: setUp

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的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

示例5: assertCreateConnection

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的package包/类
protected void assertCreateConnection(String uri) throws Exception {
   // Start up a broker with a tcp connector.
   broker = new BrokerService();
   broker.setPersistent(false);
   broker.setUseJmx(false);
   TransportConnector connector = broker.addConnector(uri);
   broker.start();

   URI temp = new URI(uri);
   // URI connectURI = connector.getServer().getConnectURI();
   // TODO this sometimes fails when using the actual local host name
   URI currentURI = new URI(connector.getPublishableConnectString());

   // sometimes the actual host name doesn't work in this test case
   // e.g. on OS X so lets use the original details but just use the actual
   // port
   URI connectURI = new URI(temp.getScheme(), temp.getUserInfo(), temp.getHost(), currentURI.getPort(), temp.getPath(), temp.getQuery(), temp.getFragment());

   LOG.info("connection URI is: " + connectURI);

   // This should create the connection.
   ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(connectURI);
   connection = (ActiveMQConnection) cf.createConnection();
   assertNotNull(connection);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:ActiveMQConnectionFactoryTest.java

示例6: createBroker

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的package包/类
@Override
protected String createBroker() throws Exception {
    brokerService = new BrokerService();
    brokerService.setBrokerName("PooledConnectionSessionCleanupTestBroker");
    brokerService.setUseJmx(true);
    brokerService.getManagementContext().setCreateConnector(false);
    brokerService.setPersistent(false);
    brokerService.setSchedulerSupport(false);
    brokerService.setAdvisorySupport(false);
    TransportConnector connector = brokerService.addConnector("tcp://0.0.0.0:61626");
    brokerService.start();
    brokerService.waitUntilStarted();

    return "failover:(" + connector.getPublishableConnectString() + ")?maxReconnectAttempts=5";
}
 
开发者ID:messaginghub,项目名称:pooled-jms,代码行数:16,代码来源:PooledConnectionFailoverTest.java

示例7: assertCreateConnection

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的package包/类
protected void assertCreateConnection(String uri) throws Exception {
   // Start up a broker with a tcp connector.
   broker = new BrokerService();
   broker.setPersistent(false);
   broker.setUseJmx(false);
   TransportConnector connector = broker.addConnector(uri);
   broker.start();

   URI temp = new URI(uri);
   // URI connectURI = connector.getServer().getConnectURI();
   // TODO this sometimes fails when using the actual local host name
   URI currentURI = new URI(connector.getPublishableConnectString());

   // sometimes the actual host name doesn't work in this test case
   // e.g. on OS X so lets use the original details but just use the actual
   // port
   URI connectURI = new URI(temp.getScheme(), temp.getUserInfo(), temp.getHost(), currentURI.getPort(), temp.getPath(), temp.getQuery(), temp.getFragment());

   LOG.info("connection URI is: " + connectURI);

   // This should create the connection.
   ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory(connectURI);
   Connection connection = cf.createConnection();

   assertXAConnection(connection);

   assertNotNull(connection);
   connection.close();

   connection = cf.createXAConnection();

   assertXAConnection(connection);

   assertNotNull(connection);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:36,代码来源:ActiveMQXAConnectionFactoryTest.java

示例8: setUp

import org.apache.activemq.broker.TransportConnector; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
   super.setUp();
   broker = new BrokerService();
   TransportConnector transportConnector = broker.addConnector("tcp://localhost:0");
   KahaDBStore store = new KahaDBStore();
   store.setDirectory(new File("data"));
   broker.setPersistenceAdapter(store);
   broker.start();

   brokerURL = "failover:(" + transportConnector.getPublishableConnectString() + ")";
   consumerBrokerURL = brokerURL + "?jms.prefetchPolicy.all=100";

   mbeanServer = ManagementFactory.getPlatformMBeanServer();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:DurableSubscriberNonPersistentMessageTest.java


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