Search in sources :

Example 26 with SjmsComponent

use of org.apache.camel.component.sjms.SjmsComponent in project ddf by codice.

the class TestMessageBroker method setupCamelContext.

private void setupCamelContext() throws Exception {
    camelContext = new DefaultCamelContext();
    ConnectionFactory factory = getServiceManager().getService(ConnectionFactory.class);
    SjmsComponent sjms = new SjmsComponent();
    sjms.setConnectionFactory(factory);
    camelContext.addComponent("sjms", sjms);
    camelContext.addRoutes(new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from(SJMS_EXAMPLE_TEST_TOPIC).to(MOCK_EXAMPLE_TEST_ROUTE);
            from(SJMS_UNDELIVERED_TEST_QUEUE).process(exchange -> {
                if (BLOW_UP.get()) {
                    throw new Exception("Boom!!!");
                }
            }).to(MOCK_UNDELIVERED_TEST_ENDPOINT);
        }
    });
    camelContext.start();
}
Also used : ConnectionFactory(javax.jms.ConnectionFactory) RouteBuilder(org.apache.camel.builder.RouteBuilder) SjmsComponent(org.apache.camel.component.sjms.SjmsComponent) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) URISyntaxException(java.net.URISyntaxException)

Example 27 with SjmsComponent

use of org.apache.camel.component.sjms.SjmsComponent in project camel by apache.

the class MllpTcpServerConsumerTransactionTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    SjmsComponent target = new SjmsComponent();
    target.setConnectionFactory(broker.createConnectionFactory());
    registry.bind("target", target);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) SjmsComponent(org.apache.camel.component.sjms.SjmsComponent)

Aggregations

SjmsComponent (org.apache.camel.component.sjms.SjmsComponent)27 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)19 CamelContext (org.apache.camel.CamelContext)19 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)7 ConnectionFactory (javax.jms.ConnectionFactory)5 Test (org.junit.Test)4 ConnectionFactoryResource (org.apache.camel.component.sjms.jms.ConnectionFactoryResource)3 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)3 MyAsyncComponent (org.apache.camel.component.sjms.support.MyAsyncComponent)2 JmsTemplate (org.springframework.jms.core.JmsTemplate)2 ComponentProxyComponent (io.syndesis.integration.component.proxy.ComponentProxyComponent)1 File (java.io.File)1 URISyntaxException (java.net.URISyntaxException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Produces (javax.enterprise.inject.Produces)1 Named (javax.inject.Named)1 ActiveMQConnectionFactory (org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory)1 Component (org.apache.camel.Component)1