Search in sources :

Example 41 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class JmsHttpJmsTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("jms", amq);
    return answer;
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 42 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class JmsJettyAsyncTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("activemq", amq);
    return answer;
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 43 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class JmsPerformanceTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", new MyBean());
    // add AMQ client and make use of connection pooling we depend on because of the (large) number
    // of the JMS messages we do produce
    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("activemq", amq);
    return answer;
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 44 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class JmsPollEnrichTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    deleteDirectory("activemq-data");
    JndiContext answer = new JndiContext();
    // add ActiveMQ with embedded broker which must be persistent
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createPersistentConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("jms", amq);
    return answer;
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) JndiContext(org.apache.camel.util.jndi.JndiContext)

Example 45 with JndiContext

use of org.apache.camel.util.jndi.JndiContext in project camel by apache.

the class JmsResequencerTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("activemq", amq);
    answer.bind("myBean1", b1);
    answer.bind("myBean2", b2);
    answer.bind("myBean3", b3);
    return answer;
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) JndiContext(org.apache.camel.util.jndi.JndiContext)

Aggregations

JndiContext (org.apache.camel.util.jndi.JndiContext)75 ConnectionFactory (javax.jms.ConnectionFactory)16 JmsComponent (org.apache.camel.component.jms.JmsComponent)16 CamelContext (org.apache.camel.CamelContext)6 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)3 ArrayList (java.util.ArrayList)2 RouteBuilder (org.apache.camel.builder.RouteBuilder)2 InvocationHandler (java.lang.reflect.InvocationHandler)1 Method (java.lang.reflect.Method)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 Endpoint (org.apache.camel.Endpoint)1 JndiRegistry (org.apache.camel.impl.JndiRegistry)1 ProcessorEndpoint (org.apache.camel.impl.ProcessorEndpoint)1 IoFilter (org.apache.mina.common.IoFilter)1 IoFilter (org.apache.mina.core.filterchain.IoFilter)1 Test (org.junit.Test)1