Package org.apache.camel.processor.aggregate

Examples of org.apache.camel.processor.aggregate.UseLatestAggregationStrategy


        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                        .log("Start ${body}")
                        .split(body().tokenize("@"), new UseLatestAggregationStrategy()).parallelProcessing().streaming()
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws Exception {
                                int num = exchange.getIn().getBody(int.class);
                                final long sleep = num * delay;
 
View Full Code Here


            @Override
            public void configure() throws Exception {
                // START SNIPPET: e1
                from("direct:start")
                    // aggregate timeout after 3th seconds
                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000)
                    .to("mock:result");
                // END SNIPPET: e1
            }
        };
    }
View Full Code Here

            @Override
            public void configure() throws Exception {
                for (int i = 0; i < AggregateTimeoutWithExecutorServiceTest.NUM_AGGREGATORS; ++i) {
                    from("direct:start" + i)
                        // aggregate timeout after 3th seconds
                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000)
                        .to("mock:result" + i);
                }
            }
        };
    }   
View Full Code Here

                            if (exchange.getIn().getBody().equals("Damn")) {
                                throw new IllegalArgumentException();
                            }
                            return ExpressionBuilder.headerExpression("id").evaluate(exchange, type);
                        }
                    }, new UseLatestAggregationStrategy())
                    .completionTimeout(500)
                    .to("mock:result");
            }
        };
    }
View Full Code Here

            public void configure() throws Exception {
                final String exceptionString = "This is an Error not an Exception";
                errorHandler(deadLetterChannel("mock:error"));

                from("direct:start")
                    .aggregate(header("id"), new UseLatestAggregationStrategy())
                    .completionSize(5)
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            throw new java.lang.NoSuchMethodError(exceptionString);  
                        }
View Full Code Here

        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                // START SNIPPET: e1
                from("direct:start")
                    .aggregate(header("id"), new UseLatestAggregationStrategy())
                        // trigger completion every 5th second
                        .completionInterval(5000)
                    .to("mock:result");
                // END SNIPPET: e1
            }
View Full Code Here

            @Override
            public void configure() throws Exception {
                onException(IllegalArgumentException.class).handled(true).to("mock:handled");

                from("direct:start")
                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(1000L)
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            String body = exchange.getIn().getBody(String.class);
                            if ("Damn".equals(body)) {
                                throw new IllegalArgumentException("Damn");
View Full Code Here

        if (strategy == null && strategyRef != null) {
            strategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
        }
        if (strategy == null) {
            // fallback to use latest
            strategy = new UseLatestAggregationStrategy();
        }
        return strategy;
    }       
View Full Code Here

        if (strategyRef != null) {
            aggregationStrategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
        }
        if (aggregationStrategy == null) {
            // default to use latest aggregation strategy
            aggregationStrategy = new UseLatestAggregationStrategy();
        }
        if (executorServiceRef != null) {
            executorService = routeContext.lookup(executorServiceRef, ExecutorService.class);
        }
        return new MulticastProcessor(list, aggregationStrategy, isParallelProcessing(), executorService, isStreaming());
View Full Code Here

        if (strategy == null && strategyRef != null) {
            strategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
        }
        if (strategy == null) {
            // fallback to use latest
            strategy = new UseLatestAggregationStrategy();
        }
        return strategy;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.aggregate.UseLatestAggregationStrategy

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.