Package org.apache.camel

Examples of org.apache.camel.CamelContext.addRoutes()


    protected void runTest(RouteBuilder builder, ArrayList<String> expected, String header) throws Exception {

        order.clear();
        CamelContext container = new DefaultCamelContext();

        container.addRoutes(builder);
        container.start();

        Endpoint endpoint = container.getEndpoint("direct:a");
        Exchange exchange = endpoint.createExchange();
        if (header != null) {
View Full Code Here


  
    public void testStartServiceTwice() 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

                from("cxf:http://localhost:7070/test?serviceClass=org.apache.camel.component.cxf.HelloService")
                    .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

        // Note we can explicit name the component
        context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        // END SNIPPET: e2
        // Add some configuration by hand ...
        // START SNIPPET: e3
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("test-jms:queue:test.queue").to("file://test");
            }
        });
        // END SNIPPET: e3
View Full Code Here

    /**
     * A helper method to create a list of Route objects for a given route builder
     */
    public static List<Route> getRouteList(RouteBuilder builder) throws Exception {
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(builder);
        context.start();
        List<Route> answer = context.getRoutes();
        context.stop();
        return answer;
    }
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

        runScript(scriptName);
        List<RouteBuilder> list = RubyCamel.getRoutes();

        log.info("Found route builders: " + list);
        for (RouteBuilder routeBuilder : list) {
            answer.addRoutes(routeBuilder);
        }

        return answer;
    }
View Full Code Here

        context.bind("bye", new SayService("Good Bye!"));

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

        camelContext.addRoutes(getRouteBuilder(camelContext));

        camelContext.start();

        // START SNIPPET: invoke
        Endpoint endpoint = camelContext.getEndpoint("direct:hello");
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.