Search in sources :

Example 11 with JMSConfiguration

use of org.apache.activemq.artemis.jms.server.config.JMSConfiguration 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)

Aggregations

JMSConfiguration (org.apache.activemq.artemis.jms.server.config.JMSConfiguration)11 JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)11 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)7 Configuration (org.apache.activemq.artemis.core.config.Configuration)6 JMSQueueConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl)6 JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)5 JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)4 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 InVMNamingContext (org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)4 Before (org.junit.Before)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 InVMAcceptorFactory (org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory)2 NettyAcceptorFactory (org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory)2 TopicConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.TopicConfigurationImpl)2 EmbeddedJMS (org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS)2 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)2