use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.
the class Jms method sjms.
@Produces
@Named("sjms")
@ApplicationScoped
SjmsComponent sjms() {
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useShutdownHook=false&broker.useJmx=false"));
component.setConnectionCount(maxConnections);
return component;
}
use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.
the class SjmsBatchConsumerAsyncStartTest method createCamelContext.
// lets just test that any of the existing tests works
@Override
public CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("testStrategy", new ListAggregationStrategy());
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(broker.getTcpConnectorUri());
SjmsComponent sjmsComponent = new SjmsComponent();
sjmsComponent.setConnectionFactory(connectionFactory);
SjmsBatchComponent sjmsBatchComponent = new SjmsBatchComponent();
sjmsBatchComponent.setConnectionFactory(connectionFactory);
// turn on async start listener
sjmsBatchComponent.setAsyncStartListener(true);
CamelContext context = new DefaultCamelContext(registry);
context.addComponent("sjms", sjmsComponent);
context.addComponent("sjms-batch", sjmsBatchComponent);
return context;
}
use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.
the class TransactedProducerInOutErrorTest method test.
@Test(expected = IllegalArgumentException.class)
public void test() throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(createRouteBuilder());
SjmsComponent component = context.getComponent("sjms", SjmsComponent.class);
component.setConnectionFactory(CamelJmsTestHelper.createConnectionFactory());
try {
context.start();
} catch (Throwable t) {
LOG.info("Exception was thrown as expected", t);
throw t;
}
}
use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.
the class TransactedQueueProducerTest method createCamelContext.
/*
* @see org.apache.camel.test.junit4.CamelTestSupport#createCamelContext()
* @return
* @throws Exception
*/
@Override
protected CamelContext createCamelContext() throws Exception {
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useJmx=false");
CamelContext camelContext = super.createCamelContext();
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.
the class InOnlyTopicDurableConsumerTest method createCamelContext.
/*
* @see org.apache.camel.test.junit4.CamelTestSupport#createCamelContext()
*
* @return
* @throws Exception
*/
@Override
protected CamelContext createCamelContext() throws Exception {
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URI);
ConnectionFactoryResource connectionResource = new ConnectionFactoryResource();
connectionResource.setConnectionFactory(connectionFactory);
connectionResource.setClientId(CONNECTION_ID);
CamelContext camelContext = super.createCamelContext();
SjmsComponent component = new SjmsComponent();
component.setConnectionResource(connectionResource);
component.setConnectionCount(1);
camelContext.addComponent("sjms", component);
return camelContext;
}
Aggregations