Package org.apache.camel

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


        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("rmi://localhost:9876/bye");

                // When exposing an RMI endpoint, the interfaces it exposes must
                // be configured.
View Full Code Here


        Context context = new JndiContext();
        context.bind("testnode", node);
        node.set("ksession", session);
       
        CamelContext camelContext = new DefaultCamelContext(context);
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:test-session").policy(new DroolsPolicy()).unmarshal("json").to("drools://testnode/ksession").marshal("json");
                from("direct:unmarshall").policy(new DroolsPolicy()).unmarshal("json");
                from("direct:marshall").policy(new DroolsPolicy()).marshal("json");
View Full Code Here

        Context context = new JndiContext();
        context.bind("testnode", node);
        node.set("ksession", session);

        CamelContext camelContext = new DefaultCamelContext(context);
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {         
                JaxbDataFormat jdf = new JaxbDataFormat();
                jdf.setContextPath("org.drools.camel.testdomain");
                jdf.setPrettyPrint(true);
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

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

        // Note we can explicitly name the component
        context.addComponent("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

    public void testNoXsltFile() throws Exception {
        try {
            RouteBuilder builder = createRouteBuilder();
            CamelContext context = new DefaultCamelContext();
            context.addRoutes(builder);
            context.start();

            fail("Should have thrown an exception due XSLT file not found");
        } catch (FailedToCreateRouteException e) {
            // expected
View Full Code Here

        try {
            CamelContext context = new DefaultCamelContext();

            final CountDownLatch latch = new CountDownLatch(ITERS);

            context.addRoutes(new RouteBuilder() {

                @Override
                public void configure() throws Exception {
                    from("direct:a").thread(4).process(new Processor() {
View Full Code Here

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

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

        return answer;
    }
View Full Code Here

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

        // Note we can explicitly name the component
        context.addComponent("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

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.