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