use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by rh-messaging.
the class FailoverPriorityTest method testPriorityBackup.
@Test
public void testPriorityBackup() throws Exception {
Configuration config0 = createConfig("127.0.0.1", 0);
Configuration config1 = createConfig("127.0.0.1", 1);
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
servers[0] = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
servers[1] = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
servers[0].start();
servers[1].start();
Assert.assertTrue(servers[0].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Assert.assertTrue(servers[1].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Thread.sleep(1000);
setClientUrl("failover:(" + BROKER_A_CLIENT_TC_ADDRESS + "," + BROKER_B_CLIENT_TC_ADDRESS + ")?randomize=false&priorityBackup=true&initialReconnectDelay=1000&useExponentialBackOff=false");
createClients(5);
assertAllConnectedTo(urls.get(0));
restart(false, 0, 1);
for (int i = 0; i < 3; i++) {
restart(true, 0, 1);
}
Thread.sleep(5000);
restart(false, 0, 1);
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by rh-messaging.
the class FailoverPriorityTest method testPriorityBackupAndUpdateClients.
@Test
public void testPriorityBackupAndUpdateClients() throws Exception {
Configuration config0 = createConfig("127.0.0.1", 0);
Configuration config1 = createConfig("127.0.0.1", 1);
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
servers[0] = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
servers[1] = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
servers[0].start();
servers[1].start();
Assert.assertTrue(servers[0].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Assert.assertTrue(servers[1].waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Thread.sleep(1000);
setClientUrl("failover:(" + BROKER_A_CLIENT_TC_ADDRESS + "," + BROKER_B_CLIENT_TC_ADDRESS + ")?randomize=false&priorityBackup=true&initialReconnectDelay=1000&useExponentialBackOff=false");
createClients(5);
// Let's wait a little bit longer just in case it takes a while to realize that the
// Broker A is the one with higher priority.
Thread.sleep(5000);
assertAllConnectedTo(urls.get(0));
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by rh-messaging.
the class FailoverPriorityTest method setupThreeBrokers.
private void setupThreeBrokers() throws Exception {
params.put("rebalanceClusterClients", "false");
params.put("updateClusterClients", "false");
params.put("updateClusterClientsOnRemove", "false");
Configuration config0 = createConfig("127.0.0.1", 0, params);
Configuration config1 = createConfig("127.0.0.1", 1, params);
Configuration config2 = createConfig("127.0.0.1", 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 rh-messaging.
the class AMQ1925Test method createNewServer.
private EmbeddedJMS createNewServer() throws Exception {
Configuration config = createConfig("localhost", 0);
EmbeddedJMS server = new EmbeddedJMS().setConfiguration(config).setJmsConfiguration(new JMSConfigurationImpl());
return server;
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by rh-messaging.
the class FailoverBackupLeakTest method setUp.
@Before
public void setUp() throws Exception {
Configuration config0 = createConfig("127.0.0.1", 0);
Configuration config1 = createConfig("127.0.0.1", 1);
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
s1 = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
s2 = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
s1.start();
s2.start();
Assert.assertTrue(s1.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Assert.assertTrue(s2.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
}
Aggregations