use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
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 apache.
the class FailoverRandomTest method setUp.
@Before
public void setUp() throws Exception {
Map<String, String> params = new HashMap<>();
params.put("rebalanceClusterClients", "true");
params.put("updateClusterClients", "true");
params.put("updateClusterClientsOnRemove", "true");
params.put("brokerName", "A");
Configuration config0 = createConfig("127.0.0.1", 0, params);
params.put("brokerName", "B");
Configuration config1 = createConfig("127.0.0.2", 1, params);
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
server0 = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
server1 = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
server0.start();
server1.start();
Assert.assertTrue(server0.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Assert.assertTrue(server1.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class FailoverTimeoutTest method setUp.
@Before
public void setUp() throws Exception {
Configuration config = createConfig(0);
server = new EmbeddedJMS().setConfiguration(config).setJmsConfiguration(new JMSConfigurationImpl());
server.start();
tcpUri = new URI(newURI(0));
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class TwoBrokerFailoverClusterTest method setUp.
@Before
public void setUp() throws Exception {
HashMap<String, String> map = new HashMap<>();
map.put("rebalanceClusterClients", "true");
map.put("updateClusterClients", "true");
map.put("updateClusterClientsOnRemove", "true");
Configuration config0 = createConfig("127.0.0.1", 0, map);
Configuration config1 = createConfig("127.0.0.1", 1, map);
deployClusterConfiguration(config0, 1);
deployClusterConfiguration(config1, 0);
server0 = new EmbeddedJMS().setConfiguration(config0).setJmsConfiguration(new JMSConfigurationImpl());
server1 = new EmbeddedJMS().setConfiguration(config1).setJmsConfiguration(new JMSConfigurationImpl());
clientUrl = "failover://(" + newURI("127.0.0.1", 0) + "," + newURI("127.0.0.1", 1) + ")";
server0.start();
server1.start();
Assert.assertTrue(server0.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
Assert.assertTrue(server1.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
}
use of org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl in project activemq-artemis by apache.
the class ConnectionHangOnStartupTest method createMaster.
protected void createMaster() throws Exception {
Configuration config = createConfig("localhost", 0, 62001);
master = new EmbeddedJMS().setConfiguration(config).setJmsConfiguration(new JMSConfigurationImpl());
master.start();
}
Aggregations