use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class AMQPToJMSCoreTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
server = createServer(true, true);
server.start();
server.waitForActivation(10, TimeUnit.SECONDS);
Configuration serverConfig = server.getConfiguration();
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
serverConfig.setSecurityEnabled(false);
coreQueue = new SimpleString(queueName);
server.createQueue(coreQueue, RoutingType.ANYCAST, coreQueue, null, false, false);
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class SharedStoreDontWaitForActivationTest method setupSharedStoreMasterPolicy.
private void setupSharedStoreMasterPolicy(int node) {
ActiveMQServer server = getServer(node);
SharedStoreMasterPolicyConfiguration liveConfiguration = new SharedStoreMasterPolicyConfiguration();
liveConfiguration.setFailoverOnServerShutdown(true);
liveConfiguration.setWaitForActivation(false);
Configuration config = server.getConfiguration();
config.setHAPolicyConfiguration(liveConfiguration);
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class SingleLiveMultipleBackupsFailoverTest method createBackupConfig.
protected void createBackupConfig(int liveNode, int nodeid, int... nodes) throws Exception {
TransportConfiguration backupConnector = createTransportConfiguration(isNetty(), false, generateParams(nodeid, isNetty()));
Configuration config1 = super.createDefaultInVMConfig().clearAcceptorConfigurations().addAcceptorConfiguration(createTransportConfiguration(isNetty(), true, generateParams(nodeid, isNetty()))).setHAPolicyConfiguration(sharedStore ? new SharedStoreSlavePolicyConfiguration() : new ReplicatedPolicyConfiguration()).addConnectorConfiguration(backupConnector.getName(), backupConnector).setBindingsDirectory(getBindingsDir() + "_" + liveNode).setJournalDirectory(getJournalDir() + "_" + liveNode).setPagingDirectory(getPageDir() + "_" + liveNode).setLargeMessagesDirectory(getLargeMessagesDir() + "_" + liveNode);
String[] staticConnectors = new String[nodes.length];
for (int i = 0; i < nodes.length; i++) {
TransportConfiguration liveConnector = createTransportConfiguration(isNetty(), false, generateParams(nodes[i], isNetty()));
config1.addConnectorConfiguration(liveConnector.getName(), liveConnector);
staticConnectors[i] = liveConnector.getName();
}
config1.addClusterConfiguration(basicClusterConnectionConfig(backupConnector.getName(), staticConnectors));
servers.put(nodeid, new SameProcessActiveMQServer(createInVMFailoverServer(true, config1, nodeManager, nodeid)));
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class MultiThreadRandomReattachTest method start.
@Override
protected void start() throws Exception {
Configuration liveConf = createDefaultInVMConfig();
server = createServer(false, liveConf);
server.getConfiguration().getAddressConfigurations().add(new CoreAddressConfiguration().setName(ADDRESS.toString()).addRoutingType(RoutingType.MULTICAST));
server.start();
waitForServerToStart(server);
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class MultiThreadConsumerStressTest method setupServer.
private void setupServer(final JournalType journalType) throws Exception {
Configuration config = createDefaultNettyConfig().setJournalType(journalType).setJournalFileSize(ActiveMQDefaultConfiguration.getDefaultJournalFileSize()).setJournalMinFiles(ActiveMQDefaultConfiguration.getDefaultJournalMinFiles()).setJournalCompactMinFiles(2).setJournalCompactPercentage(50);
server = createServer(true, config);
server.start();
ServerLocator locator = createNettyNonHALocator().setBlockOnDurableSend(false).setBlockOnNonDurableSend(false).setBlockOnAcknowledge(false);
sf = createSessionFactory(locator);
ClientSession sess = sf.createSession();
try {
sess.createQueue(ADDRESS, QUEUE, true);
} catch (Exception ignored) {
}
sess.close();
locator.close();
locator = createInVMNonHALocator();
sf = createSessionFactory(locator);
}
Aggregations