Search in sources :

Example 1 with JmsConfiguration

use of org.apache.camel.component.jms.JmsConfiguration in project camel by apache.

the class JmsProviderTest method testTemporaryDestinationTypes.

@Test
public void testTemporaryDestinationTypes() throws Exception {
    JmsEndpoint endpoint = getMandatoryEndpoint("activemq:test.queue", JmsEndpoint.class);
    JmsConfiguration configuration = endpoint.getConfiguration();
    JmsProviderMetadata providerMetadata = configuration.getProviderMetadata();
    assertNotNull("provider", providerMetadata);
    Class<? extends TemporaryQueue> queueType = endpoint.getTemporaryQueueType();
    Class<? extends TemporaryTopic> topicType = endpoint.getTemporaryTopicType();
    log.info("Found queue type: " + queueType);
    log.info("Found topic type: " + topicType);
    assertNotNull("queueType", queueType);
    assertNotNull("topicType", topicType);
    assertEquals("queueType", ActiveMQTempQueue.class, queueType);
    assertEquals("topicType", ActiveMQTempTopic.class, topicType);
}
Also used : JmsProviderMetadata(org.apache.camel.component.jms.JmsProviderMetadata) JmsEndpoint(org.apache.camel.component.jms.JmsEndpoint) JmsConfiguration(org.apache.camel.component.jms.JmsConfiguration) Test(org.junit.Test)

Example 2 with JmsConfiguration

use of org.apache.camel.component.jms.JmsConfiguration in project ddf by codice.

the class OpenwireProducerConsumerExample method createCamelContext.

private void createCamelContext() throws Exception {
    CamelContext camelContext = getContext();
    ConnectionFactory jmsConnectFactory = createConnectionFactory();
    PooledConnectionFactory jmsPooledConnectionFactory = new PooledConnectionFactory();
    jmsPooledConnectionFactory.setConnectionFactory(jmsConnectFactory);
    jmsPooledConnectionFactory.setMaxConnections(2);
    JmsTransactionManager jmsTransactionManager = new JmsTransactionManager();
    jmsTransactionManager.setConnectionFactory(jmsConnectFactory);
    JmsConfiguration jmsConfiguration = new JmsConfiguration();
    jmsConfiguration.setConnectionFactory(jmsPooledConnectionFactory);
    jmsConfiguration.setTransacted(true);
    jmsConfiguration.setTransactionManager(jmsTransactionManager);
    jmsConfiguration.setCacheLevelName("CACHE_CONSUMER");
    JmsComponent jms = new JmsComponent();
    jms.setConfiguration(jmsConfiguration);
    camelContext.addComponent("jms", jms);
}
Also used : CamelContext(org.apache.camel.CamelContext) ActiveMQSslConnectionFactory(org.apache.activemq.ActiveMQSslConnectionFactory) ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) JmsConfiguration(org.apache.camel.component.jms.JmsConfiguration) JmsTransactionManager(org.springframework.jms.connection.JmsTransactionManager)

Aggregations

JmsConfiguration (org.apache.camel.component.jms.JmsConfiguration)2 ConnectionFactory (javax.jms.ConnectionFactory)1 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 ActiveMQSslConnectionFactory (org.apache.activemq.ActiveMQSslConnectionFactory)1 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)1 CamelContext (org.apache.camel.CamelContext)1 JmsComponent (org.apache.camel.component.jms.JmsComponent)1 JmsEndpoint (org.apache.camel.component.jms.JmsEndpoint)1 JmsProviderMetadata (org.apache.camel.component.jms.JmsProviderMetadata)1 Test (org.junit.Test)1 JmsTransactionManager (org.springframework.jms.connection.JmsTransactionManager)1