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