public ActiveMQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors) { if (ha) { serverLocator = ActiveMQClient.createServerLocatorWithHA(initialConnectors); } else { serverLocator = ActiveMQClient.createServerLocatorWithoutHA(initialConnectors); } serverLocator.disableFinalizeCheck(); }
public ActiveMQConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration) { if (ha) { serverLocator = ActiveMQClient.createServerLocatorWithHA(groupConfiguration); } else { serverLocator = ActiveMQClient.createServerLocatorWithoutHA(groupConfiguration); } serverLocator.disableFinalizeCheck(); }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { TransportConfiguration tc = InVMTransportConfigurationSchema.createTransportConfiguration(uri, query, name, "org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"); ServerLocator factory = ActiveMQClient.createServerLocatorWithoutHA(tc); return BeanSupport.setData(uri, factory, query); }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); List<TransportConfiguration> configurations = TCPTransportConfigurationSchema.getTransportConfigurations(uri, query, TransportConstants.ALLOWABLE_CONNECTOR_KEYS, name, NettyConnectorFactory.class.getName()); TransportConfiguration[] tcs = new TransportConfiguration[configurations.size()]; configurations.toArray(tcs); if (options.isHa()) { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithHA(tcs), query); } else { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithoutHA(tcs), query); } }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); DiscoveryGroupConfiguration dcConfig = getDiscoveryGroupConfiguration(uri, query, name); if (options.isHa()) { return ActiveMQClient.createServerLocatorWithHA(dcConfig); } else { return ActiveMQClient.createServerLocatorWithoutHA(dcConfig); } }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); DiscoveryGroupConfiguration dgc = getDiscoveryGroupConfiguration(uri, query, getHost(uri), getPort(uri), name); if (options.isHa()) { return ActiveMQClient.createServerLocatorWithHA(dgc); } else { return ActiveMQClient.createServerLocatorWithoutHA(dgc); } }
public ActiveMQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors) { if (ha) { serverLocator = ActiveMQClient.createServerLocatorWithHA(initialConnectors); } else { serverLocator = ActiveMQClient.createServerLocatorWithoutHA(initialConnectors); } serverLocator.disableFinalizeCheck(); }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { TransportConfiguration tc = InVMTransportConfigurationSchema.createTransportConfiguration(uri, query, name, "org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"); ServerLocator factory = ActiveMQClient.createServerLocatorWithoutHA(tc); return BeanSupport.setData(uri, factory, query); }
public ActiveMQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors) { if (ha) { serverLocator = ActiveMQClient.createServerLocatorWithHA(initialConnectors); } else { serverLocator = ActiveMQClient.createServerLocatorWithoutHA(initialConnectors); } serverLocator.disableFinalizeCheck(); }
protected void setSessionFactoryCreateLocator(int node, boolean ha, TransportConfiguration serverTotc) { if (ha) { locators[node] = ActiveMQClient.createServerLocatorWithHA(serverTotc); } else { locators[node] = ActiveMQClient.createServerLocatorWithoutHA(serverTotc); } }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); List<TransportConfiguration> configurations = TCPTransportConfigurationSchema.getTransportConfigurations(uri, query, TransportConstants.ALLOWABLE_CONNECTOR_KEYS, name, NettyConnectorFactory.class.getName()); TransportConfiguration[] tcs = new TransportConfiguration[configurations.size()]; configurations.toArray(tcs); if (options.isHa()) { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithHA(tcs), query); } else { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithoutHA(tcs), query); } }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); List<TransportConfiguration> configurations = TCPTransportConfigurationSchema.getTransportConfigurations(uri, query, TransportConstants.ALLOWABLE_CONNECTOR_KEYS, name, NettyConnectorFactory.class.getName()); TransportConfiguration[] tcs = new TransportConfiguration[configurations.size()]; configurations.toArray(tcs); if (options.isHa()) { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithHA(tcs), query); } else { return BeanSupport.setData(uri, ActiveMQClient.createServerLocatorWithoutHA(tcs), query); } }
@Override protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception { ConnectionOptions options = newConnectionOptions(uri, query); DiscoveryGroupConfiguration dgc = getDiscoveryGroupConfiguration(uri, query, getHost(uri), getPort(uri), name); if (options.isHa()) { return ActiveMQClient.createServerLocatorWithHA(dgc); } else { return ActiveMQClient.createServerLocatorWithoutHA(dgc); } }
@Test public void testCloseUnusedClientSessionFactoryWithoutGlobalPools() throws Exception { ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(liveTC); ClientSessionFactory csf = createSessionFactory(locator); csf.close(); }
@Override @Before public void setUp() throws Exception { super.setUp(); HashMap<String, Object> params = new HashMap<>(); params.put(TransportConstants.HTTP_ENABLED_PROP_NAME, true); conf = createDefaultInVMConfig().clearAcceptorConfigurations().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params)); server = addServer(ActiveMQServers.newActiveMQServer(conf, false)); server.start(); locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, params))); }
@Before public void setUp() throws Exception { locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName())); testDir = temporaryFolder.getRoot().getAbsolutePath(); ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin"); Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)); server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false); }
protected final ServerLocator createLocator(final boolean ha, final int serverID) { TransportConfiguration targetConfig = createTransportConfiguration(useNetty(), false, generateParams(serverID, useNetty())); if (ha) { ServerLocator locator = ActiveMQClient.createServerLocatorWithHA(targetConfig); return addServerLocator(locator); } else { ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(targetConfig); return addServerLocator(locator); } }
@Test public void testStaticConnectorListConstructor() throws Exception { TransportConfiguration[] tc = new TransportConfiguration[]{liveTC}; ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(tc); assertFactoryParams(locator, tc, null, ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD, ActiveMQClient.DEFAULT_CONNECTION_TTL, ActiveMQClient.DEFAULT_CALL_TIMEOUT, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE, ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE, ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE, ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE, ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE, ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND, ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND, ActiveMQClient.DEFAULT_AUTO_GROUP, ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE, ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE, ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS, ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE, ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE, ActiveMQClient.DEFAULT_RETRY_INTERVAL, ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER, ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS); ClientSessionFactory cf = createSessionFactory(locator); ClientSession session = cf.createSession(false, true, true); Assert.assertNotNull(session); session.close(); testSettersThrowException(cf); cf.close(); }
@Test public void testSingleConnectorSingleServer() throws Exception { ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(createTransportConfiguration(isNetty(), false, generateParams(0, isNetty()))); ClientSessionFactory csf = createSessionFactory(locator); csf.close(); locator.close(); }
@Before public void setUp() throws Exception { locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName())); testDir = temporaryFolder.getRoot().getAbsolutePath(); LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin().setInitialContextFactory("com.sun.jndi.ldap.LdapCtxFactory").setConnectionURL("ldap://localhost:1024").setConnectionUsername("uid=admin,ou=system").setConnectionPassword("secret").setConnectionProtocol("s").setAuthentication("simple"); ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin"); Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin); server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false); }