Search in sources :

Example 1 with JMSConfigurationImpl

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;
}
Also used : JMSConfiguration(org.apache.activemq.artemis.jms.server.config.JMSConfiguration) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)

Example 2 with JMSConfigurationImpl

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;
}
Also used : AddressSettings(org.apache.activemq.artemis.core.settings.impl.AddressSettings) EmbeddedJMS(org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS) Configuration(org.apache.activemq.artemis.core.config.Configuration) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)

Example 3 with JMSConfigurationImpl

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;
}
Also used : EmbeddedJMS(org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS) Configuration(org.apache.activemq.artemis.core.config.Configuration) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)

Example 4 with JMSConfigurationImpl

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));
}
Also used : EmbeddedJMS(org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS) Configuration(org.apache.activemq.artemis.core.config.Configuration) HashMap(java.util.HashMap) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)

Example 5 with JMSConfigurationImpl

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);
}
Also used : EmbeddedJMS(org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS) Configuration(org.apache.activemq.artemis.core.config.Configuration) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl) Test(org.junit.Test) OpenwireArtemisBaseTest(org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest)

Aggregations

JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)38 Configuration (org.apache.activemq.artemis.core.config.Configuration)33 EmbeddedJMS (org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS)27 Before (org.junit.Before)12 JMSConfiguration (org.apache.activemq.artemis.jms.server.config.JMSConfiguration)11 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)9 Test (org.junit.Test)8 HashMap (java.util.HashMap)7 JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)7 OpenwireArtemisBaseTest (org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest)7 JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)6 JMSQueueConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl)6 InVMNamingContext (org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)6 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)4 ConnectionFactoryConfiguration (org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration)4 ConnectionFactoryConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl)4 MessageProducer (javax.jms.MessageProducer)3 Queue (javax.jms.Queue)3 Session (javax.jms.Session)3 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)3