Search in sources :

Example 6 with JMSQueueConfigurationImpl

use of org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl in project activemq-artemis by apache.

the class ManualReconnectionToSingleServerTest method setUp.

// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    context = new InVMNamingContext();
    server = createServer(false, createDefaultNettyConfig());
    JMSConfiguration configuration = new JMSConfigurationImpl();
    serverManager = new JMSServerManagerImpl(server, configuration);
    serverManager.setRegistry(new JndiBindingRegistry(context));
    configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl().setName(QUEUE_NAME).setBindings(QUEUE_NAME));
    ArrayList<TransportConfiguration> configs = new ArrayList<>();
    configs.add(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
    ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(registerConnectors(server, configs)).setBindings("/cf").setRetryInterval(1000).setReconnectAttempts(-1);
    configuration.getConnectionFactoryConfigurations().add(cfConfig);
    serverManager.start();
    listener = new Listener();
    exceptionLatch = new CountDownLatch(1);
    reconnectionLatch = new CountDownLatch(1);
    allMessagesReceived = new CountDownLatch(1);
}
Also used : JMSConfiguration(org.apache.activemq.artemis.jms.server.config.JMSConfiguration) MessageListener(javax.jms.MessageListener) ExceptionListener(javax.jms.ExceptionListener) ArrayList(java.util.ArrayList) JndiBindingRegistry(org.apache.activemq.artemis.core.registry.JndiBindingRegistry) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) CountDownLatch(java.util.concurrent.CountDownLatch) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) ConnectionFactoryConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl) JMSQueueConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl) ConnectionFactoryConfiguration(org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration) InVMNamingContext(org.apache.activemq.artemis.tests.unit.util.InVMNamingContext) Before(org.junit.Before)

Example 7 with JMSQueueConfigurationImpl

use of org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl in project spring-boot by spring-projects.

the class ArtemisEmbeddedServerConfiguration method addQueues.

private void addQueues(JMSConfiguration configuration, String[] queues) {
    boolean persistent = this.properties.getEmbedded().isPersistent();
    for (String queue : queues) {
        JMSQueueConfigurationImpl jmsQueueConfiguration = new JMSQueueConfigurationImpl();
        jmsQueueConfiguration.setName(queue);
        jmsQueueConfiguration.setDurable(persistent);
        jmsQueueConfiguration.setBindings("/queue/" + queue);
        configuration.getQueueConfigurations().add(jmsQueueConfiguration);
    }
}
Also used : JMSQueueConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl)

Aggregations

JMSQueueConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl)7 JMSConfiguration (org.apache.activemq.artemis.jms.server.config.JMSConfiguration)6 JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)6 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)5 Configuration (org.apache.activemq.artemis.core.config.Configuration)4 ConnectionFactoryConfiguration (org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration)4 ConnectionFactoryConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl)4 JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)3 JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)3 InVMNamingContext (org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)3 Before (org.junit.Before)3 ArrayList (java.util.ArrayList)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)2 TopicConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.TopicConfigurationImpl)2 EmbeddedJMS (org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS)2 HashMap (java.util.HashMap)1 CyclicBarrier (java.util.concurrent.CyclicBarrier)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Connection (javax.jms.Connection)1