Search in sources :

Example 1 with ActiveMQConnectionFactory

use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project spring-boot by spring-projects.

the class ArtemisAutoConfigurationTests method nativeConnectionFactoryIfEmbeddedServiceDisabledExplicitly.

@Test
public void nativeConnectionFactoryIfEmbeddedServiceDisabledExplicitly() {
    // No mode is specified
    load(EmptyConfiguration.class, "spring.artemis.embedded.enabled:false");
    assertThat(this.context.getBeansOfType(EmbeddedJMS.class)).isEmpty();
    ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
    assertNettyConnectionFactory(connectionFactory, "localhost", 61616);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) Test(org.junit.Test)

Example 2 with ActiveMQConnectionFactory

use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project spring-boot by spring-projects.

the class ArtemisAutoConfigurationTests method nativeConnectionFactoryCustomHost.

@Test
public void nativeConnectionFactoryCustomHost() {
    load(EmptyConfiguration.class, "spring.artemis.mode:native", "spring.artemis.host:192.168.1.144", "spring.artemis.port:9876");
    ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
    assertNettyConnectionFactory(connectionFactory, "192.168.1.144", 9876);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) Test(org.junit.Test)

Example 3 with ActiveMQConnectionFactory

use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project spring-boot by spring-projects.

the class ArtemisAutoConfigurationTests method embeddedConnectionFactory.

@Test
public void embeddedConnectionFactory() {
    load(EmptyConfiguration.class, "spring.artemis.mode:embedded");
    ArtemisProperties properties = this.context.getBean(ArtemisProperties.class);
    assertThat(properties.getMode()).isEqualTo(ArtemisMode.EMBEDDED);
    assertThat(this.context.getBeansOfType(EmbeddedJMS.class)).hasSize(1);
    org.apache.activemq.artemis.core.config.Configuration configuration = this.context.getBean(org.apache.activemq.artemis.core.config.Configuration.class);
    assertThat(configuration.isPersistenceEnabled()).isFalse();
    assertThat(configuration.isSecurityEnabled()).isFalse();
    ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
    assertInVmConnectionFactory(connectionFactory);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) Test(org.junit.Test)

Example 4 with ActiveMQConnectionFactory

use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project ddf by codice.

the class ActiveMQJMSClientFactoryWrapper method createConnectionFactory.

public ActiveMQConnectionFactory createConnectionFactory() throws Exception {
    ActiveMQConnectionFactory connectionFactory = ActiveMQJMSClient.createConnectionFactory(PropertyResolver.resolveProperties(url), name).setUser(username).setPassword(encryptionService.decryptValue(new String(password)));
    connectionFactory.setRetryInterval(retryInterval);
    connectionFactory.setRetryIntervalMultiplier(retryIntervalMultiplier);
    connectionFactory.setReconnectAttempts(reconnectAttempts);
    return connectionFactory;
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory)

Example 5 with ActiveMQConnectionFactory

use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory in project ddf by codice.

the class ActiveMQJMSClientFactoryWrapperTest method createConnectionFactory.

@Test
public void createConnectionFactory() throws Exception {
    ActiveMQConnectionFactory activeMQConnectionFactory = activeMQJMSClientFactoryWrapper.createConnectionFactory();
    assertThat(activeMQConnectionFactory, notNullValue());
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) Test(org.junit.Test)

Aggregations

ActiveMQConnectionFactory (org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory)221 Test (org.junit.Test)141 Connection (javax.jms.Connection)84 Session (javax.jms.Session)84 MessageProducer (javax.jms.MessageProducer)63 MessageConsumer (javax.jms.MessageConsumer)60 TextMessage (javax.jms.TextMessage)49 Queue (javax.jms.Queue)48 ConnectionFactory (javax.jms.ConnectionFactory)35 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)27 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)26 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)24 ActiveMQResourceAdapter (org.apache.activemq.artemis.ra.ActiveMQResourceAdapter)24 URI (java.net.URI)22 JMSException (javax.jms.JMSException)20 Message (javax.jms.Message)19 DiscoveryGroupConfiguration (org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration)19 InitialContext (javax.naming.InitialContext)16 Context (javax.naming.Context)15 Hashtable (java.util.Hashtable)14