use of org.apache.activemq.artemis.core.config.impl.FileConfiguration in project activemq-artemis by apache.
the class ConfigurationValidationTest method testFullConfiguration.
@Test
public void testFullConfiguration() throws Exception {
FileConfiguration fc = new FileConfiguration();
FileDeploymentManager deploymentManager = new FileDeploymentManager("ConfigurationTest-full-config.xml");
deploymentManager.addDeployable(fc);
deploymentManager.readConfiguration();
Assert.assertEquals(true, fc.isPersistDeliveryCountBeforeDelivery());
}
use of org.apache.activemq.artemis.core.config.impl.FileConfiguration in project activemq-artemis by apache.
the class JMSServerStartStopTest method setUp.
@Override
@Before
public void setUp() throws Exception {
FileConfiguration fc = new FileConfiguration();
FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml");
deploymentManager.addDeployable(fc);
deploymentManager.addDeployable(fileConfiguration);
deploymentManager.readConfiguration();
ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration());
ActiveMQServer server = addServer(new ActiveMQServerImpl(fc, sm));
jmsServer = new JMSServerManagerImpl(server, fileConfiguration);
jmsServer.setRegistry(null);
}
use of org.apache.activemq.artemis.core.config.impl.FileConfiguration in project activemq-artemis by apache.
the class ConfigurationTest method getActiveMQServer.
protected ActiveMQServer getActiveMQServer(String brokerConfig) throws Exception {
FileConfiguration fc = new FileConfiguration();
FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
FileDeploymentManager deploymentManager = new FileDeploymentManager(brokerConfig);
deploymentManager.addDeployable(fc);
deploymentManager.addDeployable(fileConfiguration);
deploymentManager.readConfiguration();
ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration());
return addServer(new ActiveMQServerImpl(fc, sm));
}
use of org.apache.activemq.artemis.core.config.impl.FileConfiguration in project activemq-artemis by apache.
the class XmlConfigPluginTest method createServerFromConfig.
private ActiveMQServer createServerFromConfig(String configFileName) throws Exception {
FileConfiguration fc = new FileConfiguration();
FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
FileDeploymentManager deploymentManager = new FileDeploymentManager(configFileName);
deploymentManager.addDeployable(fc);
deploymentManager.addDeployable(fileConfiguration);
deploymentManager.readConfiguration();
return addServer(new ActiveMQServerImpl(fc));
}
use of org.apache.activemq.artemis.core.config.impl.FileConfiguration in project activemq-artemis by apache.
the class PerfJournal method execute.
@Override
public Object execute(ActionContext context) throws Exception {
super.execute(context);
FileConfiguration fileConfiguration = getFileConfiguration();
if (nosyncs) {
fileConfiguration.setJournalDatasync(false);
} else if (syncs) {
fileConfiguration.setJournalDatasync(true);
}
if (journalType != null) {
fileConfiguration.setJournalType(JournalType.getType(journalType));
}
System.out.println("");
System.out.println("Auto tuning journal ...");
System.out.println("Performing " + tries + " tests writing " + writes + " blocks of " + size + " on each test, sync=" + fileConfiguration.isJournalDatasync() + " with journalType = " + fileConfiguration.getJournalType());
fileConfiguration.getJournalLocation().mkdirs();
if (maxAIO <= 0) {
maxAIO = fileConfiguration.getJournalMaxIO_AIO();
}
long time = SyncCalculation.syncTest(fileConfiguration.getJournalLocation(), size, writes, tries, verbose, fileConfiguration.isJournalDatasync(), syncWrites, fileName, maxAIO, fileConfiguration.getJournalType());
long nanosecondsWait = SyncCalculation.toNanos(time, writes, verbose);
double writesPerMillisecond = (double) writes / (double) time;
String writesPerMillisecondStr = new DecimalFormat("###.##").format(writesPerMillisecond);
context.out.println("Your system can execute " + writesPerMillisecondStr + " syncs per millisecond");
context.out.println("Your journal-buffer-timeout should be:" + nanosecondsWait);
context.out.println("You should use this following configuration:");
context.out.println();
context.out.println("<journal-buffer-timeout>" + nanosecondsWait + "</journal-buffer-timeout>");
return null;
}
Aggregations