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());
}
}
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);
}
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;
}
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);
}
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;
}
Aggregations