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("pojo:bye");
            }
        });
        // END SNIPPET: route
View Full Code Here


        final CountDownLatch latch = new CountDownLatch(1);

        CamelContext context = new DefaultCamelContext();

        // lets add some routes
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("seda:test.a").to("seda:test.b");
                from("seda:test.b").process(new Processor() {
                    public void process(Exchange e) {
                        log.debug("Received exchange: " + e.getIn());
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);

        CamelContext context = new DefaultCamelContext();

        // lets add some routes
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("seda:test.a").to("seda:test.b");
                from("seda:test.b").process(new Processor() {
                    public void process(Exchange e) {
                        log.debug("Received exchange: " + e.getIn());
View Full Code Here

                 * TODO keep old DSL? .intercept() .add(interceptor1)
                 * .add(interceptor2) .target().to("direct:d");
                 */
            }
        };
        container.addRoutes(builder);
        container.start();

        Endpoint<Exchange> endpoint = container.getEndpoint("direct:a");
        Exchange exchange = endpoint.createExchange();
        Producer<Exchange> producer = endpoint.createProducer();
View Full Code Here

        CamelContext container = new DefaultCamelContext();

        final AtomicBoolean invoked = new AtomicBoolean();

        // lets add some routes
        container.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:test.a").to("direct:test.b");
                from("direct:test.b").process(new Processor() {
                    public void process(Exchange e) {
                        invoked.set(true);
View Full Code Here

        });

        CamelContext camelContext = new DefaultCamelContext(context);

        // lets add some routes
        camelContext.addRoutes(new RouteBuilder() {
            public void configure() {
                from("timer://foo?fixedRate=true&delay=0&period=500").to("pojo:bar");
            }
        });
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("rmi://localhost:1099/bye");

                // When exposing an RMI endpoint, the interfaces it exposes must
                // be configured.
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

        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

    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

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.