use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project narayana by jbosstm.
the class JmsHelper method getJmsConfiguration.
private JMSConfiguration getJmsConfiguration() {
JMSConfiguration jmsConfiguration = new JMSConfigurationImpl();
jmsConfiguration.getConnectionFactoryConfigurations().add(getConnectionFactoryConfiguration());
jmsConfiguration.getQueueConfigurations().add(getQueueConfiguration());
return jmsConfiguration;
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class ZeroPrefetchConsumerTest method createArtemisBroker.
@Override
public EmbeddedJMS createArtemisBroker() throws Exception {
Configuration config0 = createConfig("localhost", 0);
String coreQueueAddress = brokerZeroQueue.getQueueName();
AddressSettings addrSettings = new AddressSettings();
addrSettings.setQueuePrefetch(0);
config0.getAddressesSettings().put(coreQueueAddress, addrSettings);
EmbeddedJMS newbroker = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
return newbroker;
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class OpenwireArtemisBaseTest method createBroker.
public EmbeddedJMS createBroker() throws Exception {
Configuration config0 = createConfig(0);
EmbeddedJMS newbroker = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
return newbroker;
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class FailoverComplexClusterTest method commonSetup.
// default setup for most tests
private void commonSetup() throws Exception {
Map<String, String> params = new HashMap<>();
params.put("rebalanceClusterClients", "true");
params.put("updateClusterClients", "true");
params.put("updateClusterClientsOnRemove", "true");
Configuration config0 = createConfig("localhost", 0, params);
Configuration config1 = createConfig("localhost", 1, params);
Configuration config2 = createConfig("localhost", 2, params);
deployClusterConfiguration(config0, 1, 2);
deployClusterConfiguration(config1, 0, 2);
deployClusterConfiguration(config2, 0, 1);
servers[0] = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
servers[1] = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
servers[2] = new EmbeddedJMS().setConfiguration(config2).setJmsConfiguration(new JMSConfigurationImpl());
servers[0].start();
servers[1].start();
servers[2].start();
Assert.assertTrue(servers[0].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 3));
Assert.assertTrue(servers[1].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 3));
Assert.assertTrue(servers[2].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 3));
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class FailoverComplexClusterTest method testFailOverWithUpdateClientsOnRemove.
@Test
public void testFailOverWithUpdateClientsOnRemove() throws Exception {
// Broker A
Configuration config0 = createConfig(0, "?rebalanceClusterClients=true&updateClusterClients=true&updateClusterClientsOnRemove=true");
// Broker B
Configuration config1 = createConfig(1, "?rebalanceClusterClients=true&updateClusterClients=true&updateClusterClientsOnRemove=true");
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
servers[0] = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
servers[0].start();
servers[1] = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
servers[1].start();
servers[0].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2);
servers[1].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2);
Thread.sleep(1000);
// create client connecting only to A. It should receive broker B address whet it connects to A.
setClientUrl("failover:(" + BROKER_A_CLIENT_TC_ADDRESS + ")?useExponentialBackOff=true");
createClients(1);
Thread.sleep(5000);
// We stop broker A.
servers[0].stop();
servers[1].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 1);
Thread.sleep(5000);
// Client should failover to B.
assertAllConnectedTo(BROKER_B_CLIENT_TC_ADDRESS);
}
Aggregations