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());
}
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());
}
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());
}
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;
}
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;
}
Aggregations