Search in sources :

Example 6 with Configuration

use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.

the class Embedded method start.

public void start() throws Exception {
    System.out.println("\nStarting Embedded");
    if (activeMQServer == null) {
        Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
        activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
        activeMQServer.start();
    }
    tjws.start();
    manager.setConfiguration(config);
    manager.start();
    tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
    tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) MessageServiceConfiguration(org.apache.activemq.artemis.rest.MessageServiceConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)

Example 7 with Configuration

use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.

the class PersistentPushQueueConsumerTest method startup.

public static void startup() throws Exception {
    Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
    activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
    activeMQServer.start();
    deployment = EmbeddedContainer.start();
    manager = new MessageServiceManager(null);
    manager.start();
    deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
    deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) MessageServiceManager(org.apache.activemq.artemis.rest.MessageServiceManager) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)

Example 8 with Configuration

use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.

the class EmbeddedActiveMQResourceCustomConfigurationTest method testCustomConfiguration.

@Test
public void testCustomConfiguration() throws Exception {
    Configuration configuration = server.getServer().getActiveMQServer().getConfiguration();
    assertFalse("Persistence should have been disabled", configuration.isPersistenceEnabled());
    assertTrue("Security should have been enabled", configuration.isSecurityEnabled());
    assertNotNull(TEST_QUEUE + " should exist", server.locateQueue(TEST_QUEUE));
    List<Queue> boundQueues = server.getBoundQueues(TEST_ADDRESS);
    assertNotNull("List should never be null", boundQueues);
    assertEquals("Should have one queue bound to address " + TEST_ADDRESS, 1, boundQueues.size());
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) CoreQueueConfiguration(org.apache.activemq.artemis.core.config.CoreQueueConfiguration) Queue(org.apache.activemq.artemis.core.server.Queue) Test(org.junit.Test)

Example 9 with Configuration

use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.

the class PrintData method execute.

@Override
public Object execute(ActionContext context) throws Exception {
    super.execute(context);
    Configuration configuration = getParameterConfiguration();
    try {
        if (configuration.isJDBC()) {
            printDataJDBC(configuration, context.out);
        } else {
            printData(new File(getBinding()), new File(getJournal()), new File(getPaging()), context.out, safe);
        }
    } catch (Exception e) {
        treatError(e, "data", "print");
    }
    return null;
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) File(java.io.File)

Example 10 with Configuration

use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.

the class CompactJournal method execute.

@Override
public Object execute(ActionContext context) throws Exception {
    super.execute(context);
    try {
        Configuration configuration = getFileConfiguration();
        compactJournal(new File(getJournal()), "activemq-data", "amq", configuration.getJournalMinFiles(), configuration.getJournalFileSize(), null);
        System.out.println("Compactation succeeded for " + getJournal());
        compactJournal(new File(getBinding()), "activemq-bindings", "bindings", 2, 1048576, null);
        System.out.println("Compactation succeeded for " + getBinding());
    } catch (Exception e) {
        treatError(e, "data", "compact");
    }
    return null;
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) File(java.io.File)

Aggregations

Configuration (org.apache.activemq.artemis.core.config.Configuration)331 Test (org.junit.Test)143 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)120 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)109 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)108 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)101 ClientProducer (org.apache.activemq.artemis.api.core.client.ClientProducer)93 ClientMessage (org.apache.activemq.artemis.api.core.client.ClientMessage)90 ClientConsumer (org.apache.activemq.artemis.api.core.client.ClientConsumer)81 ClientSessionFactory (org.apache.activemq.artemis.api.core.client.ClientSessionFactory)78 StoreConfiguration (org.apache.activemq.artemis.core.config.StoreConfiguration)78 DivertConfiguration (org.apache.activemq.artemis.core.config.DivertConfiguration)72 Before (org.junit.Before)59 ServerLocator (org.apache.activemq.artemis.api.core.client.ServerLocator)58 DatabaseStorageConfiguration (org.apache.activemq.artemis.core.config.storage.DatabaseStorageConfiguration)57 HashMap (java.util.HashMap)56 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)52 ActiveMQDefaultConfiguration (org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration)35 SharedStoreMasterPolicyConfiguration (org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration)35 ActiveMQBuffer (org.apache.activemq.artemis.api.core.ActiveMQBuffer)34