use of org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration in project spring-boot by spring-projects.
the class ArtemisEmbeddedServerConfiguration method embeddedActiveMq.
@Bean(initMethod = "start", destroyMethod = "stop")
@ConditionalOnMissingBean
EmbeddedActiveMQ embeddedActiveMq(org.apache.activemq.artemis.core.config.Configuration configuration, JMSConfiguration jmsConfiguration, ObjectProvider<ArtemisConfigurationCustomizer> configurationCustomizers) throws Exception {
for (JMSQueueConfiguration queueConfiguration : jmsConfiguration.getQueueConfigurations()) {
String queueName = queueConfiguration.getName();
configuration.addAddressConfiguration(new CoreAddressConfiguration().setName(queueName).addRoutingType(RoutingType.ANYCAST).addQueueConfiguration(new QueueConfiguration(queueName).setAddress(queueName).setFilterString(queueConfiguration.getSelector()).setDurable(queueConfiguration.isDurable()).setRoutingType(RoutingType.ANYCAST)));
}
for (TopicConfiguration topicConfiguration : jmsConfiguration.getTopicConfigurations()) {
configuration.addAddressConfiguration(new CoreAddressConfiguration().setName(topicConfiguration.getName()).addRoutingType(RoutingType.MULTICAST));
}
configurationCustomizers.orderedStream().forEach((customizer) -> customizer.customize(configuration));
EmbeddedActiveMQ embeddedActiveMq = new EmbeddedActiveMQ();
embeddedActiveMq.setConfiguration(configuration);
return embeddedActiveMq;
}
use of org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration in project camel by apache.
the class Jms2TestSupport method configureBroker.
protected void configureBroker(EmbeddedJMS broker) throws Exception {
Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setJournalDirectory("target/data/journal").setSecurityEnabled(false).addAcceptorConfiguration("connector", brokerUri + "?protocols=CORE,AMQP,HORNETQ,OPENWIRE").addAcceptorConfiguration("vm", "vm://broker").addConnectorConfiguration("connector", new TransportConfiguration(NettyConnectorFactory.class.getName()));
JMSConfiguration jmsConfig = new JMSConfigurationImpl();
ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(Arrays.asList("connector")).setBindings("cf");
jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl().setName("queue1").setDurable(false).setBindings("queue/queue1");
jmsConfig.getQueueConfigurations().add(queueConfig);
broker.setConfiguration(configuration).setJmsConfiguration(jmsConfig);
}
Aggregations