Examples of JmsComponent


Examples of org.apache.camel.component.jms.JmsComponent

     * Adds a local in memory JMS component for the test
     */
    private void addTestJmsComponent() {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://test?broker.persistent=false");
        JmsConfiguration jmsConfig = new JmsConfiguration(connectionFactory);
        JmsComponent component = new JmsComponent(jmsConfig);
        context.addComponent("jms", component);
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    }

    private void addJmsComponent(CamelContext context) {
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
        JmsConfiguration jmsConfig = new JmsConfiguration(cf);
        context.addComponent("jms", new JmsComponent(jmsConfig));
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

   
    public void run() throws Exception {
        CamelContext context = new DefaultCamelContext();
        JmsConfiguration jmsConfig = new JmsConfiguration(new ActiveMQConnectionFactory("tcp://localhost:61616"));
        context.addComponent("jms", new JmsComponent(jmsConfig ));
        context.setTracing(true);
        context.addRoutes(new Jms2RestRoute());
        context.start();
        System.in.read();
        context.stop();
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();

        // add ActiveMQ with embedded broker
        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
        amq.setCamelContext(context);

        answer.bind("activemq", amq);
        return answer;
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    private Logger log = Logger.getLogger(getClass());

    public void testRollbackUsingXmlQueueToQueueRequestReplyUsingDynamicMessageSelector() throws Exception {

        JmsComponent c = (JmsComponent)context.getComponent("activemq");
        JmsComponent c1 = (JmsComponent)context.getComponent("activemq-1");
        final ConditionalExceptionProcessor cp = new ConditionalExceptionProcessor(10);
        context.addRoutes(new SpringRouteBuilder() {
            @Override
            public void configure() throws Exception {
                Policy required = bean(SpringTransactionPolicy.class, "PROPAGATION_REQUIRED_POLICY");
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    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);
        jms.getConfiguration().setJmsKeyFormatStrategy(new PassThroughJmsKeyFormatStrategy());

        return camelContext;
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

        broker.setPersistent(false);
        broker.setTimeBeforePurgeTempDestinations(1000);
        broker.start();

        DefaultCamelContext context = new DefaultCamelContext();
        JmsComponent jmsComponent = new JmsComponent();

        /**
         *
         */
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("failover://(tcp://localhost:61616)?maxReconnectAttempts=1");

        /**
         * When using Tibco EMS the problem can be recreated. As the broker is
         * external it has to be stopped and started by hand.
         */
        // TibjmsConnectionFactory connectionFactory = new
        // TibjmsConnectionFactory();
        // connectionFactory.setReconnAttemptCount(1);

        jmsComponent.setConnectionFactory(connectionFactory);
        jmsComponent.setRequestTimeout(1000);
        jmsComponent.setReceiveTimeout(1000);
        context.addComponent("jms", jmsComponent);
        context.addRoutes(new RouteBuilder() {

            @Override
            public void configure() throws Exception {
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    }
   
    @Override
    // setup the ActiveMQ component and register it into the camel context
    protected void setupCamelContext(CamelContext camelContext) throws Exception {
        JmsComponent answer = new JmsComponent();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm://localhost.spring.javaconfig?marshal=false&broker.persistent=false&broker.useJmx=false");
        answer.setConnectionFactory(connectionFactory);       
        camelContext.addComponent("jms", answer);       
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

        // setup the ActiveMQ component
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm://localhost.spring.javaconfig?marshal=false&broker.persistent=false&broker.useJmx=false");

        // and register it into the CamelContext
        JmsComponent answer = new JmsComponent();
        answer.setConnectionFactory(connectionFactory);
        camelContext.addComponent("jms", answer);
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

   
    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=true");
        JmsComponent component = JmsComponent.jmsComponent(connectionFactory);
        component.setConcurrentConsumers(4);
        answer.bind("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        answer.bind("myBean1", b1);
        answer.bind("myBean2", b2);
        answer.bind("myBean3", b3);
        return answer;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.