use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project narayana by jbosstm.
the class JmsHelper method getCoreConfiguration.
private Configuration getCoreConfiguration() {
Configuration configuration = new ConfigurationImpl();
configuration.setPersistenceEnabled(false);
configuration.setJournalDirectory("target/data/journal");
configuration.setSecurityEnabled(false);
configuration.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
configuration.getConnectorConfigurations().put("connector", new TransportConfiguration(InVMConnectorFactory.class.getName()));
return configuration;
}
use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project wildfly by wildfly.
the class ArtemisRunListener method startServer.
private synchronized ActiveMQServer startServer() throws Exception {
if (server == null) {
Configuration config = new ConfigurationImpl().setName("Test-Broker").addAcceptorConfiguration("netty", getBrokerUrl()).setSecurityEnabled(false).setPersistenceEnabled(false).setJournalFileSize(10 * 1024 * 1024).setJournalDeviceBlockSize(4096).setJournalMinFiles(2).setJournalDatasync(true).setJournalPoolFiles(10).addConnectorConfiguration("netty", getBrokerUrl());
File dataPlace = new File(getArtemisHome());
FileUtil.deleteDirectory(dataPlace);
config.setJournalDirectory(new File(dataPlace, "./journal").getAbsolutePath()).setPagingDirectory(new File(dataPlace, "./paging").getAbsolutePath()).setLargeMessagesDirectory(new File(dataPlace, "./largemessages").getAbsolutePath()).setBindingsDirectory(new File(dataPlace, "./bindings").getAbsolutePath()).setPersistenceEnabled(true);
server = ActiveMQServers.newActiveMQServer(config, PERSISTENCE);
server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLQ")).setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue")).setRedeliveryDelay(0).setMaxSizeBytes(-1).setMessageCounterHistoryDayLimit(10).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setAutoCreateQueues(true).setAutoCreateAddresses(true).setAutoCreateJmsQueues(true).setAutoCreateJmsTopics(true));
server.getAddressSettingsRepository().addMatch("activemq.management#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLQ")).setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue")).setRedeliveryDelay(0).setMaxSizeBytes(-1).setMessageCounterHistoryDayLimit(10).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setAutoCreateQueues(true).setAutoCreateAddresses(true).setAutoCreateJmsQueues(true).setAutoCreateJmsTopics(true));
server.start();
server.waitForActivation(10, TimeUnit.SECONDS);
}
return server;
}
use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project spring-boot by spring-projects.
the class ArtemisEmbeddedConfigurationFactory method createConfiguration.
Configuration createConfiguration() {
ConfigurationImpl configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
configuration.setPersistenceEnabled(this.properties.isPersistent());
String dataDir = getDataDir();
configuration.setJournalDirectory(dataDir + "/journal");
if (this.properties.isPersistent()) {
configuration.setJournalType(JournalType.NIO);
configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
configuration.setBindingsDirectory(dataDir + "/bindings");
configuration.setPagingDirectory(dataDir + "/paging");
}
TransportConfiguration transportConfiguration = new TransportConfiguration(InVMAcceptorFactory.class.getName(), this.properties.generateTransportParameters());
configuration.getAcceptorConfigurations().add(transportConfiguration);
if (this.properties.isDefaultClusterPassword() && logger.isDebugEnabled()) {
logger.debug("Using default Artemis cluster password: " + this.properties.getClusterPassword());
}
configuration.setClusterPassword(this.properties.getClusterPassword());
configuration.addAddressConfiguration(createAddressConfiguration("DLQ"));
configuration.addAddressConfiguration(createAddressConfiguration("ExpiryQueue"));
configuration.addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLQ")).setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue")));
return configuration;
}
use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project scout.rt by eclipse.
the class ArtemisJmsBrokerTestRule method createArtemisServerConfig.
protected Configuration createArtemisServerConfig() {
Configuration config = new ConfigurationImpl();
config.setSecurityEnabled(false);
config.addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
config.addAddressesSetting("#", new AddressSettings().setExpiryAddress(new SimpleString("jms.queue.ExpiryQueue")).setDeadLetterAddress(new SimpleString("jms.queue.DLQ")));
config.addQueueConfiguration(createQueue("jms.topic.scout.mom.requestreply.cancellation"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicPublishFirst"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testProperties"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReplyTimeout"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReplyRequestFirst"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReplyMultipleSubscriptions"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReplyCorrelationId"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicPublishSubscribeMultipleSubscriptions"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testQueueRequestReplyJsonObjectMarshaller"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReplyCancellation"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicRequestReply"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testTopicPublishSubscribeCorrelationId"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testMessageSelector"));
config.addQueueConfiguration(createQueue("jms.topic.test/mom/testQueueRequestReplyCancellation"));
config.addQueueConfiguration(createQueue("jms.topic.differentTopic"));
config.addQueueConfiguration(createQueue("jms.topic.scout.physical.UnitTestTopic"));
config.addQueueConfiguration(createQueue("Durable-Test-Subscription").setAddress("jms.topic.test/mom/testTopicPublishSubscribe"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishBytes"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishText"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishObject"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testConcurrentMessageConsumption"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishAndConsumeInternal"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testSubscribeTransactional"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testQueuePublishFirst"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishJsonData"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishJsonDataSecure"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testQueueRequestReplyRequestFirst"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishTransactional"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishStringData"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testPublishObjectData"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testCurrentMessagePubSub"));
config.addQueueConfiguration(createQueue("jms.queue.test/mom/testSerialMessageConsumption"));
return config;
}
use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl 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