use of org.apache.activemq.ActiveMQConnectionFactory in project camel by apache.
the class JmsTestSupport method createCamelContext.
/*
* @see org.apache.camel.test.junit4.CamelTestSupport#createCamelContext()
* @return
* @throws Exception
*/
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUri);
connection = connectionFactory.createConnection();
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
SjmsComponent component = new SjmsComponent();
component.setConnectionCount(1);
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project camel by apache.
the class BatchTransactedProducerSupport method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerUri());
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project camel by apache.
the class TransactedConsumerSupport method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerUri());
// use low redelivery delay to speed
connectionFactory.getRedeliveryPolicy().setInitialRedeliveryDelay(100);
connectionFactory.getRedeliveryPolicy().setRedeliveryDelay(100);
connectionFactory.getRedeliveryPolicy().setUseCollisionAvoidance(false);
connectionFactory.getRedeliveryPolicy().setUseExponentialBackOff(false);
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project camel by apache.
the class ManualBatchFromQueueTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("testStrategy", new ListAggregationStrategy());
CamelContext camel = new DefaultCamelContext(registry);
SjmsBatchComponent sjms = new SjmsBatchComponent();
sjms.setAsyncStartListener(true);
log.info("Using live connection to existing ActiveMQ broker running on {}", url);
sjms.setConnectionFactory(new ActiveMQConnectionFactory(url));
camel.addComponent("sjms-batch", sjms);
return camel;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project camel by apache.
the class ManualFromQueueTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camel = super.createCamelContext();
SjmsComponent sjms = new SjmsComponent();
log.info("Using live connection to existing ActiveMQ broker running on {}", url);
sjms.setConnectionFactory(new ActiveMQConnectionFactory(url));
camel.addComponent("sjms", sjms);
return camel;
}
Aggregations