Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultCamelContext.addRoutes()


        // Set up the ActiveMQ JMS Components
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        // Note we can explicit name of the component
        context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new Client());

        ProducerTemplate template = context.createProducerTemplate();

        context.start();
        // START SNIPPET: sending
View Full Code Here


        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");

        // Note we can explicitly name the component
        context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new LoanBroker());
        // Start the loan broker
        context.start();
        System.out.println("Server is ready");

        Thread.sleep(5 * 60 * 1000);
 
View Full Code Here

        // Start the bank server
        BankServer bankServer = new BankServer();
        bankServer.start();

        // Start the camel context
        context.addRoutes(new LoanBroker());
        context.start();

        // Start the loan broker
        Thread.sleep(5 * 60 * 1000);
        context.stop();
View Full Code Here

            broker.start();
            server.start();
            // END SNIPPET: e2
            // Add some configuration by hand ...
            // START SNIPPET: e3
            context.addRoutes(new RouteBuilder() {
                public void configure() {
                    from(ROUTER_ENDPOINT_URI).to(SERVICE_ENDPOINT_URI);              
                }
            });
            // END SNIPPET: e3
View Full Code Here

    public void testCamelWithJndi() throws Exception {
        JndiContext jndi = new JndiContext();
        jndi.bind("foo", new MyOtherDummyBean());

        CamelContext camel = new DefaultCamelContext(jndi);
        camel.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").beanRef("foo");
            }
        });
View Full Code Here

        CamelContext camelContext = new DefaultCamelContext(context);
        // END SNIPPET: register

        // START SNIPPET: route
        // lets add simple route
        camelContext.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:hello").to("bean:bye");
            }
        });
        // END SNIPPET: route
View Full Code Here

    }

    public Exchange doSignatureRouteTest(RouteBuilder builder, Exchange e, Map<String, Object> headers) throws Exception {
        CamelContext context = new DefaultCamelContext();
        try {
            context.addRoutes(builder);
            context.start();

            MockEndpoint mock = context.getEndpoint("mock:result", MockEndpoint.class);
            mock.setExpectedMessageCount(1);
View Full Code Here

                        header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT))).
                    bean(new CountDownLatchDecrementer("execution report", executionReportLatch));
            }
        };
       
        context.addRoutes(routes);
       
        LOG.info("Starting Camel context");
        context.start();
       
        // This is not strictly necessary, but it prevents the need for session
View Full Code Here

    @Test
    public void startServiceTwice() throws Exception {
        CamelContext context = new DefaultCamelContext();
       
        //add the same route twice...
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("cxf:http://localhost:7070/test?serviceClass=org.apache.camel.component.cxf.HelloService")
                    .to("log:POJO");
            }
        });
View Full Code Here

                    .to("log:POJO");
            }
        });

      
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("cxf:http://localhost:7070/test?serviceClass=org.apache.camel.component.cxf.HelloService")
                    .to("log:POJO");
            }
        });           
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.