use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class WildcardConfigurationTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
wildcardConfiguration.setDelimiter('/');
Configuration configuration = createDefaultInVMConfig().setWildcardRoutingEnabled(true).setTransactionTimeoutScanPeriod(500).setWildCardConfiguration(wildcardConfiguration);
server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
server.start();
server.getManagementService().enableNotifications(false);
locator = createInVMNonHALocator();
sf = createSessionFactory(locator);
clientSession = addClientSession(sf.createSession(false, true, true));
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class NIOvsOIOTest method testPerf.
private void testPerf(boolean nio) throws Exception {
Configuration config = createDefaultInVMConfig();
Map<String, Object> params = new HashMap<>();
params.put(TransportConstants.USE_NIO_PROP_NAME, nio);
config.getAcceptorConfigurations().add(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
AddressSettings addressSettings = new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK).setMaxSizeBytes(10 * 1024 * 1024);
final String dest = "test-destination";
HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
repos.addMatch(dest, addressSettings);
server.start();
for (int i = 0; i < 2; i++) {
doTest(dest);
}
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class ClientTestBase method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
Configuration config = createDefaultNettyConfig();
server = createServer(false, config);
server.start();
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class BridgeTestBase method createActiveMQServer.
protected ActiveMQServer createActiveMQServer(final int id, final Map<String, Object> params, final boolean netty, final NodeManager nodeManager) throws Exception {
TransportConfiguration tc = new TransportConfiguration();
if (netty) {
params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME, org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + id);
tc = new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params);
} else {
params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, id);
tc = new TransportConfiguration(INVM_ACCEPTOR_FACTORY, params);
}
Configuration serviceConf = createBasicConfig().setJournalType(getDefaultJournalType()).setBindingsDirectory(getBindingsDir(id, false)).setJournalMinFiles(2).setJournalDirectory(getJournalDir(id, false)).setPagingDirectory(getPageDir(id, false)).setLargeMessagesDirectory(getLargeMessagesDir(id, false)).setJournalFileSize(100 * 1024).addAcceptorConfiguration(tc).setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration());
ActiveMQServer server;
if (nodeManager == null) {
server = ActiveMQServers.newActiveMQServer(serviceConf, true);
} else {
server = new InVMNodeManagerServer(serviceConf, nodeManager);
}
return addServer(server);
}
use of org.apache.activemq.artemis.core.config.Configuration in project activemq-artemis by apache.
the class ClientNonDivertedSoakTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
Configuration config = createDefaultConfig(isNetty()).setJournalFileSize(10 * 1024 * 1024);
server = createServer(IS_JOURNAL, config, -1, -1, new HashMap<String, AddressSettings>());
server.start();
ServerLocator locator = createFactory(isNetty());
ClientSessionFactory sf = createSessionFactory(locator);
ClientSession session = sf.createSession();
session.createQueue(ClientNonDivertedSoakTest.ADDRESS, ClientNonDivertedSoakTest.ADDRESS, true);
session.close();
sf.close();
locator.close();
}
Aggregations