use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project activemq-artemis by apache.
the class ConnectionFactoryURITest method testUDPAllProperties.
@Test
public void testUDPAllProperties() throws Exception {
StringBuilder sb = new StringBuilder();
sb.append("udp://localhost:3030?ha=true");
BeanUtilsBean bean = new BeanUtilsBean();
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(true, (TransportConfiguration) null);
populate(sb, bean, factory);
ActiveMQConnectionFactory factory2 = parser.newObject(new URI(sb.toString()), null);
checkEquals(bean, factory, factory2);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project activemq-artemis by apache.
the class ConnectionFactoryURITest method testCF.
@Test
public void testCF() throws Exception {
ActiveMQConnectionFactory factory = parser.newObject(new URI("tcp://localhost:3030?ha=true&type=CF"), null);
Assert.assertTrue(ActiveMQJMSConnectionFactory.class.getName().equals(factory.getClass().getName()));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project activemq-artemis by apache.
the class JGroupsSchema method internalNewObject.
@Override
public ActiveMQConnectionFactory internalNewObject(URI uri, Map<String, String> query, String name) throws Exception {
JMSConnectionOptions options = newConectionOptions(uri, query);
DiscoveryGroupConfiguration dcConfig = JGroupsServerLocatorSchema.getDiscoveryGroupConfiguration(uri, query, name);
ActiveMQConnectionFactory factory;
if (options.isHa()) {
factory = ActiveMQJMSClient.createConnectionFactoryWithHA(dcConfig, options.getFactoryTypeEnum());
} else {
factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(dcConfig, options.getFactoryTypeEnum());
}
return BeanSupport.setData(uri, factory, query);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project activemq-artemis by apache.
the class ConnectionFactoryURITest method testUDP.
@Test
public void testUDP() throws Exception {
ActiveMQConnectionFactory factory = parser.newObject(new URI("udp://localhost:3030?ha=true&type=QUEUE_XA_CF"), null);
Assert.assertTrue(ActiveMQXAQueueConnectionFactory.class.getName().equals(factory.getClass().getName()));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project activemq-artemis by apache.
the class ConnectionFactoryURITest method testTCPAllNettyConnectorProperties.
@Test
public void testTCPAllNettyConnectorProperties() throws Exception {
Map<String, Object> props = new HashMap<>();
Set<String> allowableConnectorKeys = TransportConstants.ALLOWABLE_CONNECTOR_KEYS;
StringBuilder sb = new StringBuilder();
sb.append("tcp://localhost:3030?ha=true");
populateConnectorParams(props, allowableConnectorKeys, sb);
ActiveMQConnectionFactory factory = parser.newObject(new URI(sb.toString()), null);
Map<String, Object> params = factory.getStaticConnectors()[0].getParams();
Assert.assertEquals(params.get("host"), "localhost");
Assert.assertEquals(params.get("port"), "3030");
for (Map.Entry<String, Object> entry : params.entrySet()) {
if (!entry.getKey().equals("host") && !entry.getKey().equals("port")) {
Assert.assertEquals(entry.getValue(), props.get(entry.getKey()));
}
}
}
Aggregations