本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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";
}
示例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);
}
示例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();
}