Search in sources :

Example 21 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)

Example 22 with SjmsComponent

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

the class CoreProducerConsumerExample method createCamelContext.

private void createCamelContext() throws Exception {
    CamelContext camelContext = getContext();
    ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactory("(tcp://0.0.0.0:5672,tcp://0.0.0.0:61617)?ha=true;sslEnabled=true;enabledCipherSuites=TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;enabledProtocols=TLSv1.1,TLSv1.2", "name");
    factory.setRetryInterval(1000);
    factory.setRetryIntervalMultiplier(1.0);
    factory.setReconnectAttempts(-1);
    SjmsComponent sjms = new SjmsComponent();
    ConnectionFactoryResource connectionResource = new ConnectionFactoryResource(1, factory, "admin", "admin");
    sjms.setConnectionResource(connectionResource);
    camelContext.addComponent("sjms", sjms);
}
Also used : CamelContext(org.apache.camel.CamelContext) ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) SjmsComponent(org.apache.camel.component.sjms.SjmsComponent) ConnectionFactoryResource(org.apache.camel.component.sjms.jms.ConnectionFactoryResource)

Example 23 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)

Aggregations

SjmsComponent (org.apache.camel.component.sjms.SjmsComponent)23 CamelContext (org.apache.camel.CamelContext)18 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)16 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)7 ConnectionFactory (javax.jms.ConnectionFactory)3 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 Test (org.junit.Test)2 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 RouteBuilder (org.apache.camel.builder.RouteBuilder)1 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)1 JndiRegistry (org.apache.camel.impl.JndiRegistry)1