Search in sources :

Example 11 with JmsComponent

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

the class JmsHttpPostIssueWithMockTest 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 12 with JmsComponent

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

the class JmsIntegrationTest method createJndiContext.

@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", myBean);
    // 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 13 with JmsComponent

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

the class JmsJaxbTest 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 14 with JmsComponent

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

the class MyApplication method setupCamelContext.

@Override
protected void setupCamelContext(CamelContext camelContext) throws Exception {
    // setup the ActiveMQ component
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
    connectionFactory.setBrokerURL("vm://localhost?broker.persistent=false&broker.useJmx=false");
    // and register it into the CamelContext
    JmsComponent answer = new JmsComponent();
    answer.setConnectionFactory(connectionFactory);
    camelContext.addComponent("jms", answer);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent)

Example 15 with JmsComponent

use of org.apache.camel.component.jms.JmsComponent 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

JmsComponent (org.apache.camel.component.jms.JmsComponent)25 ConnectionFactory (javax.jms.ConnectionFactory)21 JndiContext (org.apache.camel.util.jndi.JndiContext)16 CamelContext (org.apache.camel.CamelContext)6 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ActiveMQSslConnectionFactory (org.apache.activemq.ActiveMQSslConnectionFactory)1 BrokerService (org.apache.activemq.broker.BrokerService)1 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)1 RouteBuilder (org.apache.camel.builder.RouteBuilder)1 AMQPComponent (org.apache.camel.component.amqp.AMQPComponent)1 JmsConfiguration (org.apache.camel.component.jms.JmsConfiguration)1 PassThroughJmsKeyFormatStrategy (org.apache.camel.component.jms.PassThroughJmsKeyFormatStrategy)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 CamelBeanPostProcessor (org.apache.camel.spring.CamelBeanPostProcessor)1 JmsConnectionFactory (org.apache.qpid.jms.JmsConnectionFactory)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1