Package org.apache.camel.processor

Examples of org.apache.camel.processor.BodyInAggregatingStrategy


    public void testAggregateIgnoreInvalidCorrelationKeys() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .completionSize(2).ignoreInvalidCorrelationKeys()
                        .to("mock:result");
            }
        });
        context.start();
View Full Code Here


    public void testAggregateNotIgnoreInvalidCorrelationKeys() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .completionSize(2)
                        .to("mock:result");
            }
        });
        context.start();
View Full Code Here

                from("direct:start")
                    // aggregate all exchanges correlated by the id header.
                    // Aggregate them using the BodyInAggregatingStrategy strategy which
                    // and when the aggregated body contains A+B+C then complete the aggregation
                    // and send it to mock:aggregated
                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionPredicate(body().contains("A+B+C"))
                        .to("mock:aggregated");
                // END SNIPPET: e1
            }
        };
    }
View Full Code Here

                from("direct:start")
                    // aggregate all exchanges correlated by the id header.
                    // Aggregate them using the BodyInAggregatingStrategy strategy which
                    // and the timeout header contains the timeout in millis of inactivity them timeout and complete the aggregation
                    // and send it to mock:aggregated
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .completionTimeout(header("timeout")).completionTimeout(5000)
                        .to("mock:aggregated");
                // END SNIPPET: e1
            }
        };
View Full Code Here

            @Override
            public void configure() throws Exception {
                myPool = context.getExecutorServiceStrategy().newDefaultThreadPool(this, "myPool");

                from("direct:foo").routeId("foo")
                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionSize(3)
                        .to("mock:aggregated");

                from("direct:bar").routeId("bar")
                    .aggregate(header("id"), new BodyInAggregatingStrategy()).executorService(myPool).completionSize(3)
                        .to("mock:aggregated");
            }
        };
    }
View Full Code Here

                    // aggregate all exchanges correlated by the id header.
                    // Aggregate them using the BodyInAggregatingStrategy strategy
                    // do eager checking which means the completion predicate will use the incoming exchange
                    // which allows us to trigger completion when a certain exchange arrived which is the
                    // END message
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .eagerCheckCompletion().completionPredicate(body().isEqualTo("END"))
                        .to("mock:aggregated");
                // END SNIPPET: e1
            }
        };
View Full Code Here

                from("direct:start")
                    // aggregate all exchanges correlated by the id header.
                    // Aggregate them using the BodyInAggregatingStrategy strategy which
                    // and the timeout header contains the timeout in millis of inactivity them timeout and complete the aggregation
                    // and send it to mock:aggregated
                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionTimeout(header("timeout"))
                        .to("mock:aggregated");
                // END SNIPPET: e1
            }
        };
    }
View Full Code Here

    public void testAggregateParallelProcessing() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .eagerCheckCompletion().completionPredicate(body().isEqualTo("END")).parallelProcessing()
                        .to("mock:result");
            }
        });
        context.start();
View Full Code Here

    public void testAggregateNotParallelProcessing() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .aggregate(header("id"), new BodyInAggregatingStrategy())
                        .eagerCheckCompletion().completionPredicate(body().isEqualTo("END"))
                        .to("mock:result");
            }
        });
        context.start();
View Full Code Here

                from("direct:start")
                    // aggregate all exchanges correlated by the id header.
                    // Aggregate them using the BodyInAggregatingStrategy strategy which
                    // and the header mySize determines the number of aggregated messages should trigger the completion
                    // and send it to mock:aggregated
                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionSize(header("mySize"))
                        .to("mock:aggregated");
                // END SNIPPET: e1
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.BodyInAggregatingStrategy

Copyright © 2018 www.massapicom. 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.