Search in sources :

Example 11 with CoreAddressConfiguration

use of org.apache.activemq.artemis.core.config.CoreAddressConfiguration in project activemq-artemis by apache.

the class ActiveMQServerImpl method deployAddressesFromConfiguration.

private void deployAddressesFromConfiguration(Configuration configuration) throws Exception {
    for (CoreAddressConfiguration config : configuration.getAddressConfigurations()) {
        AddressInfo info = new AddressInfo(SimpleString.toSimpleString(config.getName()), config.getRoutingTypes());
        addOrUpdateAddressInfo(info);
        deployQueuesFromListCoreQueueConfiguration(config.getQueueConfigurations());
    }
}
Also used : CoreAddressConfiguration(org.apache.activemq.artemis.core.config.CoreAddressConfiguration)

Example 12 with CoreAddressConfiguration

use of org.apache.activemq.artemis.core.config.CoreAddressConfiguration in project activemq-artemis by apache.

the class LargeMessageReplicationTest method addQueue.

private void addQueue(Configuration serverConfig, String address, String name) {
    List<CoreAddressConfiguration> addrConfigs = serverConfig.getAddressConfigurations();
    CoreAddressConfiguration addrCfg = new CoreAddressConfiguration();
    addrCfg.setName(address);
    addrCfg.addRoutingType(RoutingType.ANYCAST);
    CoreQueueConfiguration qConfig = new CoreQueueConfiguration();
    qConfig.setName(name);
    qConfig.setAddress(address);
    addrCfg.addQueueConfiguration(qConfig);
    addrConfigs.add(addrCfg);
}
Also used : CoreAddressConfiguration(org.apache.activemq.artemis.core.config.CoreAddressConfiguration) CoreQueueConfiguration(org.apache.activemq.artemis.core.config.CoreQueueConfiguration)

Example 13 with CoreAddressConfiguration

use of org.apache.activemq.artemis.core.config.CoreAddressConfiguration in project activemq-artemis by apache.

the class MqttClusterRemoteSubscribeTest method createAddressConfiguration.

private CoreAddressConfiguration createAddressConfiguration(String TOPIC) {
    CoreAddressConfiguration coreAddressConfiguration = new CoreAddressConfiguration();
    coreAddressConfiguration.addRoutingType(RoutingType.ANYCAST);
    coreAddressConfiguration.setName(TOPIC);
    CoreQueueConfiguration coreQueueConfiguration = new CoreQueueConfiguration();
    coreQueueConfiguration.setName(TOPIC);
    coreQueueConfiguration.setAddress(TOPIC);
    coreQueueConfiguration.setRoutingType(RoutingType.ANYCAST);
    coreAddressConfiguration.addQueueConfiguration(coreQueueConfiguration);
    return coreAddressConfiguration;
}
Also used : CoreAddressConfiguration(org.apache.activemq.artemis.core.config.CoreAddressConfiguration) CoreQueueConfiguration(org.apache.activemq.artemis.core.config.CoreQueueConfiguration)

Example 14 with CoreAddressConfiguration

use of org.apache.activemq.artemis.core.config.CoreAddressConfiguration in project activemq-artemis by apache.

the class MqttClusterRemoteSubscribeTest method setupServers.

private void setupServers(String TOPIC) throws Exception {
    WildcardConfiguration wildcardConfiguration = createWildCardConfiguration();
    CoreAddressConfiguration coreAddressConfiguration = createAddressConfiguration(TOPIC);
    AddressSettings addressSettings = createAddressSettings();
    setupServer(0, false, isNetty());
    servers[0].getConfiguration().setWildCardConfiguration(wildcardConfiguration);
    servers[0].getConfiguration().addAddressConfiguration(coreAddressConfiguration);
    servers[0].getConfiguration().addAddressesSetting("#", addressSettings);
    setupServer(1, false, isNetty());
    servers[1].getConfiguration().setWildCardConfiguration(wildcardConfiguration);
    servers[1].getConfiguration().addAddressConfiguration(coreAddressConfiguration);
    servers[1].getConfiguration().addAddressesSetting("#", addressSettings);
    setupClusterConnection("cluster0", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
    setupClusterConnection("cluster1", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
}
Also used : AddressSettings(org.apache.activemq.artemis.core.settings.impl.AddressSettings) WildcardConfiguration(org.apache.activemq.artemis.core.config.WildcardConfiguration) CoreAddressConfiguration(org.apache.activemq.artemis.core.config.CoreAddressConfiguration)

Example 15 with CoreAddressConfiguration

use of org.apache.activemq.artemis.core.config.CoreAddressConfiguration in project dhis2-core by dhis2.

the class ArtemisConfig method createEmbeddedServer.

@Bean
public EmbeddedActiveMQ createEmbeddedServer(ArtemisConfigData artemisConfigData) throws Exception {
    EmbeddedActiveMQ server = new EmbeddedActiveMQ();
    org.apache.activemq.artemis.core.config.Configuration config = new ConfigurationImpl();
    ArtemisEmbeddedConfig embeddedConfig = artemisConfigData.getEmbedded();
    config.addAcceptorConfiguration("in-vm", String.format("vm://0?jms.useAsyncSend=%s&nioRemotingThreads=%d", artemisConfigData.isSendAsync(), embeddedConfig.getNioRemotingThreads()));
    config.setSecurityEnabled(embeddedConfig.isSecurity());
    config.setPersistenceEnabled(embeddedConfig.isPersistence());
    if (locationManager.externalDirectorySet() && embeddedConfig.isPersistence()) {
        String dataDir = locationManager.getExternalDirectoryPath();
        config.setJournalDirectory(dataDir + "/artemis/journal");
        config.setJournalType(JournalType.NIO);
        config.setLargeMessagesDirectory(dataDir + "/artemis/largemessages");
        config.setBindingsDirectory(dataDir + "/artemis/bindings");
        config.setPagingDirectory(dataDir + "/artemis/paging");
    }
    config.addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLQ")).setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue")));
    config.addAddressConfiguration(new CoreAddressConfiguration().setName("DLQ").addRoutingType(RoutingType.ANYCAST).addQueueConfiguration(new CoreQueueConfiguration().setName("DLQ").setRoutingType(RoutingType.ANYCAST)));
    config.addAddressConfiguration(new CoreAddressConfiguration().setName("ExpiryQueue").addRoutingType(RoutingType.ANYCAST).addQueueConfiguration(new CoreQueueConfiguration().setName("ExpiryQueue").setRoutingType(RoutingType.ANYCAST)));
    server.setConfiguration(config);
    return server;
}
Also used : AddressSettings(org.apache.activemq.artemis.core.settings.impl.AddressSettings) CoreAddressConfiguration(org.apache.activemq.artemis.core.config.CoreAddressConfiguration) CoreQueueConfiguration(org.apache.activemq.artemis.core.config.CoreQueueConfiguration) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl) EmbeddedActiveMQ(org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ) Bean(org.springframework.context.annotation.Bean)

Aggregations

CoreAddressConfiguration (org.apache.activemq.artemis.core.config.CoreAddressConfiguration)15 CoreQueueConfiguration (org.apache.activemq.artemis.core.config.CoreQueueConfiguration)8 Configuration (org.apache.activemq.artemis.core.config.Configuration)3 ArrayList (java.util.ArrayList)2 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)2 EmbeddedActiveMQ (org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ)2 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)2 JMSQueueConfiguration (org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration)2 TopicConfiguration (org.apache.activemq.artemis.jms.server.config.TopicConfiguration)2 Bean (org.springframework.context.annotation.Bean)2 Element (org.w3c.dom.Element)2 NodeList (org.w3c.dom.NodeList)2 HashSet (java.util.HashSet)1 List (java.util.List)1 QueueConfiguration (org.apache.activemq.artemis.api.core.QueueConfiguration)1 RoutingType (org.apache.activemq.artemis.api.core.RoutingType)1 FileDeploymentManager (org.apache.activemq.artemis.core.config.FileDeploymentManager)1 WildcardConfiguration (org.apache.activemq.artemis.core.config.WildcardConfiguration)1 ConfigurationImpl (org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)1 FileConfiguration (org.apache.activemq.artemis.core.config.impl.FileConfiguration)1