Search in sources :

Example 86 with Configuration

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));
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) WildcardConfiguration(org.apache.activemq.artemis.core.config.WildcardConfiguration) WildcardConfiguration(org.apache.activemq.artemis.core.config.WildcardConfiguration) Before(org.junit.Before)

Example 87 with Configuration

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);
    }
}
Also used : ActiveMQServer(org.apache.activemq.artemis.core.server.ActiveMQServer) AddressSettings(org.apache.activemq.artemis.core.settings.impl.AddressSettings) Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) HashMap(java.util.HashMap) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration)

Example 88 with Configuration

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();
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) Before(org.junit.Before)

Example 89 with Configuration

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);
}
Also used : ActiveMQServer(org.apache.activemq.artemis.core.server.ActiveMQServer) Configuration(org.apache.activemq.artemis.core.config.Configuration) SharedStoreMasterPolicyConfiguration(org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration) SharedStoreSlavePolicyConfiguration(org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) SharedStoreMasterPolicyConfiguration(org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration) InVMNodeManagerServer(org.apache.activemq.artemis.tests.util.InVMNodeManagerServer) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration)

Example 90 with Configuration

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();
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) HashMap(java.util.HashMap) ClientSession(org.apache.activemq.artemis.api.core.client.ClientSession) ClientSessionFactory(org.apache.activemq.artemis.api.core.client.ClientSessionFactory) ServerLocator(org.apache.activemq.artemis.api.core.client.ServerLocator) Before(org.junit.Before)

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