use of javax.jms.ConnectionFactory in project camel by apache.
the class JmsRequestReplyReplyToOverrideTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
JmsComponent jmsComponent = jmsComponentAutoAcknowledge(connectionFactory);
jmsComponent.getConfiguration().setReplyTo("baz");
jmsComponent.getConfiguration().setReplyToOverride("bar");
camelContext.addComponent("jms", jmsComponent);
return camelContext;
}
use of javax.jms.ConnectionFactory in project camel by apache.
the class JmsRequestReplySharedReplyToTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
return camelContext;
}
use of javax.jms.ConnectionFactory in project camel by apache.
the class JmsRouteRequestReplyTest method init.
protected static void init() {
if (inited.compareAndSet(false, true)) {
ContextBuilder contextBuilderMessageID = new ContextBuilderMessageID();
ContextBuilder contextBuilderCorrelationID = new ContextBuilder() {
public CamelContext buildContext(CamelContext context) throws Exception {
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
jmsComponent.setConnectionFactory(connectionFactory);
jmsComponent.setUseMessageIDAsCorrelationID(false);
jmsComponent.setConcurrentConsumers(maxServerTasks);
context.addComponent(componentName, jmsComponent);
return context;
}
};
ContextBuilder contextBuilderMessageIDNamedReplyToSelector = new ContextBuilder() {
public CamelContext buildContext(CamelContext context) throws Exception {
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
jmsComponent.setConnectionFactory(connectionFactory);
jmsComponent.setUseMessageIDAsCorrelationID(true);
jmsComponent.setConcurrentConsumers(maxServerTasks);
jmsComponent.getConfiguration().setReplyToDestinationSelectorName(REPLY_TO_DESTINATION_SELECTOR_NAME);
context.addComponent(componentName, jmsComponent);
return context;
}
};
ContextBuilder contextBuilderCorrelationIDNamedReplyToSelector = new ContextBuilder() {
public CamelContext buildContext(CamelContext context) throws Exception {
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
jmsComponent.setConnectionFactory(connectionFactory);
jmsComponent.setUseMessageIDAsCorrelationID(false);
jmsComponent.setConcurrentConsumers(maxServerTasks);
jmsComponent.getConfiguration().setReplyToDestinationSelectorName(REPLY_TO_DESTINATION_SELECTOR_NAME);
context.addComponent(componentName, jmsComponent);
return context;
}
};
ContextBuilder contextBuilderCorrelationIDDiffComp = new ContextBuilder() {
public CamelContext buildContext(CamelContext context) throws Exception {
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
jmsComponent.setConnectionFactory(connectionFactory);
jmsComponent.setConcurrentConsumers(maxServerTasks);
context.addComponent(componentName, jmsComponent);
ActiveMQComponent jmsComponent1 = ActiveMQComponent.activeMQComponent();
jmsComponent1.setConnectionFactory(connectionFactory);
jmsComponent1.setUseMessageIDAsCorrelationID(false);
jmsComponent1.setConcurrentConsumers(maxServerTasks);
context.addComponent(componentName1, jmsComponent1);
return context;
}
};
ContextBuilder contextBuilderMessageIDDiffComp = new ContextBuilder() {
public CamelContext buildContext(CamelContext context) throws Exception {
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
jmsComponent.setConnectionFactory(connectionFactory);
jmsComponent.setUseMessageIDAsCorrelationID(true);
jmsComponent.setConcurrentConsumers(maxServerTasks);
context.addComponent(componentName, jmsComponent);
ActiveMQComponent jmsComponent1 = ActiveMQComponent.activeMQComponent();
jmsComponent1.setConnectionFactory(connectionFactory);
jmsComponent1.setUseMessageIDAsCorrelationID(true);
jmsComponent1.setConcurrentConsumers(maxServerTasks);
context.addComponent(componentName1, jmsComponent1);
return context;
}
};
contextBuilders.put("testUseMessageIDAsCorrelationID", contextBuilderMessageID);
contextBuilders.put("testUseCorrelationID", contextBuilderCorrelationID);
contextBuilders.put("testUseMessageIDAsCorrelationIDMultiNode", contextBuilderMessageID);
contextBuilders.put("testUseCorrelationIDMultiNode", contextBuilderCorrelationID);
contextBuilders.put("testUseMessageIDAsCorrelationIDPersistReplyToMultiNode", contextBuilderMessageID);
contextBuilders.put("testUseCorrelationIDPersistReplyToMultiNode", contextBuilderCorrelationID);
contextBuilders.put("testUseMessageIDAsCorrelationIDPersistMultiReplyToMultiNode", contextBuilderMessageID);
// contextBuilders.put("testUseCorrelationIDPersistMultiReplyToMultiNode", contextBuilderCorrelationID);
contextBuilders.put("testUseMessageIDAsCorrelationIDPersistMultiReplyToWithNamedSelectorMultiNode", contextBuilderMessageIDNamedReplyToSelector);
contextBuilders.put("testUseCorrelationIDPersistMultiReplyToWithNamedSelectorMultiNode", contextBuilderCorrelationIDNamedReplyToSelector);
contextBuilders.put("testUseCorrelationIDMultiNodeDiffComponents", contextBuilderCorrelationIDDiffComp);
contextBuilders.put("testUseMessageIDAsCorrelationIDMultiNodeDiffComponents", contextBuilderMessageIDDiffComp);
contextBuilders.put("testUseMessageIDAsCorrelationIDTimeout", contextBuilderMessageID);
contextBuilders.put("testUseCorrelationIDTimeout", contextBuilderMessageID);
routeBuilders.put("testUseMessageIDAsCorrelationID", new SingleNodeRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDReplyToTempDestinationPerComponent", new SingleNodeRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDReplyToTempDestinationPerProducer", new SingleNodeRouteBuilder());
routeBuilders.put("testUseCorrelationID", new SingleNodeRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDMultiNode", new MultiNodeRouteBuilder());
routeBuilders.put("testUseCorrelationIDMultiNode", new MultiNodeRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDPersistReplyToMultiNode", new MultiNodeRouteBuilder());
routeBuilders.put("testUseCorrelationIDPersistReplyToMultiNode", new MultiNodeRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDPersistMultiReplyToMultiNode", new MultiNodeReplyToRouteBuilder());
// routeBuilders.put("testUseCorrelationIDPersistMultiReplyToMultiNode", new MultiNodeReplyToRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDPersistMultiReplyToWithNamedSelectorMultiNode", new MultiNodeReplyToRouteBuilder());
routeBuilders.put("testUseCorrelationIDPersistMultiReplyToWithNamedSelectorMultiNode", new MultiNodeReplyToRouteBuilder());
routeBuilders.put("testUseCorrelationIDMultiNodeDiffComponents", new MultiNodeDiffCompRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDMultiNodeDiffComponents", new MultiNodeDiffCompRouteBuilder());
routeBuilders.put("testUseMessageIDAsCorrelationIDTimeout", new SingleNodeDeadEndRouteBuilder());
routeBuilders.put("testUseCorrelationIDTimeout", new SingleNodeDeadEndRouteBuilder());
}
}
use of javax.jms.ConnectionFactory in project camel by apache.
the class JmsRouteTimeoutCheckerIntervalTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
JmsComponent activmq = jmsComponentAutoAcknowledge(connectionFactory);
// check 4 times per second
activmq.setRequestTimeoutCheckerInterval(250);
camelContext.addComponent("activemq", activmq);
return camelContext;
}
use of javax.jms.ConnectionFactory in project camel by apache.
the class JmsSimpleRequestCustomReplyToTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
JmsComponent jms = camelContext.getComponent("activemq", JmsComponent.class);
// as this is a unit test I dont want to wait 20 sec before timeout occurs, so we use 10
jms.getConfiguration().setRequestTimeout(10000);
return camelContext;
}
Aggregations