Search in sources :

Example 36 with ConnectionFactory

use of javax.jms.ConnectionFactory in project camel by apache.

the class JmsNotInOnlyIncludeSentJMSMessageIDTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    CamelContext camelContext = super.createCamelContext();
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext) ConnectionFactory(javax.jms.ConnectionFactory)

Example 37 with ConnectionFactory

use of javax.jms.ConnectionFactory in project camel by apache.

the class JmsNotIncludeAllJMSXPropertiesTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    CamelContext camelContext = super.createCamelContext();
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent jms = jmsComponentAutoAcknowledge(connectionFactory);
    jms.setIncludeAllJMSXProperties(false);
    camelContext.addComponent("activemq", jms);
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext) ConnectionFactory(javax.jms.ConnectionFactory)

Example 38 with ConnectionFactory

use of javax.jms.ConnectionFactory in project camel by apache.

the class JmsOnCompletionTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    CamelContext camelContext = super.createCamelContext();
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext) ConnectionFactory(javax.jms.ConnectionFactory)

Example 39 with ConnectionFactory

use of javax.jms.ConnectionFactory in project camel by apache.

the class JmsMessageCreatedStrategyComponentTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    CamelContext camelContext = super.createCamelContext();
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    camelContext.addComponent(componentName, jmsComponentAutoAcknowledge(connectionFactory));
    JmsComponent jms = camelContext.getComponent(componentName, JmsComponent.class);
    jms.setMessageCreatedStrategy(new MyMessageCreatedStrategy());
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext) ConnectionFactory(javax.jms.ConnectionFactory)

Example 40 with ConnectionFactory

use of javax.jms.ConnectionFactory in project camel by apache.

the class JmsMessageTypeTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    CamelContext camelContext = super.createCamelContext();
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    camelContext.addComponent("jms", jmsComponentAutoAcknowledge(connectionFactory));
    camelContext.getTypeConverterRegistry().addTypeConverter(byte[].class, MyFooBean.class, new MyFooBean());
    camelContext.getTypeConverterRegistry().addTypeConverter(String.class, MyFooBean.class, new MyFooBean());
    camelContext.getTypeConverterRegistry().addTypeConverter(Map.class, MyFooBean.class, new MyFooBean());
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext) ConnectionFactory(javax.jms.ConnectionFactory)

Aggregations

ConnectionFactory (javax.jms.ConnectionFactory)336 CamelContext (org.apache.camel.CamelContext)204 Test (org.junit.Test)48 Connection (javax.jms.Connection)46 JMSException (javax.jms.JMSException)43 QueueConnectionFactory (javax.jms.QueueConnectionFactory)36 TopicConnectionFactory (javax.jms.TopicConnectionFactory)36 Session (javax.jms.Session)31 JmsComponent (org.apache.camel.component.jms.JmsComponent)24 InitialContext (javax.naming.InitialContext)19 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)19 TestFailureException (org.apache.openejb.test.TestFailureException)19 EJBException (javax.ejb.EJBException)18 Message (javax.jms.Message)16 JndiContext (org.apache.camel.util.jndi.JndiContext)16 Destination (javax.jms.Destination)15 AssertionFailedError (junit.framework.AssertionFailedError)15 MessageConsumer (javax.jms.MessageConsumer)14 MessageProducer (javax.jms.MessageProducer)12 JmsTemplate (org.springframework.jms.core.JmsTemplate)12