Package org.apache.camel.processor.aggregate

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


            public void configure() throws Exception {
                // START SNIPPET: e1
                // our route is aggregating from the direct queue and sending the response to the mock
                from("direct:start")
                    // we use the collection based aggregator we already have configured
                    .aggregate(header("id"), new UseLatestAggregationStrategy())
                    .completionSize(3)
                    .to("mock:result");
                // END SNIPPET: e1
            }
        };
View Full Code Here


                // share 8 threads among the 20 routes
                ScheduledExecutorService threadPool = context.getExecutorServiceManager().newScheduledThreadPool(this, "MyThreadPool", 8);
                for (int i = 0; i < NUM_AGGREGATORS; ++i) {
                    from("direct:start" + i)
                        // aggregate timeout after 3th seconds
                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000).timeoutCheckerExecutorService(threadPool)
                        .to("mock:result" + i);
                }
            }
        };
    }
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,
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

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry jndi = super.createRegistry();
        jndi.bind("cool", cool);
        jndi.bind("agg", new UseLatestAggregationStrategy());
        return jndi;
    }
View Full Code Here

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry jndi = super.createRegistry();
        jndi.bind("cool", cool);
        jndi.bind("agg", new UseLatestAggregationStrategy());
        return jndi;
    }
View Full Code Here

public class TestRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("seda:foo")
            .aggregate(constant("messageId"), new UseLatestAggregationStrategy()).completionTimeout(1000L).
                to("seda:aggregated");
    }
View Full Code Here

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:foo").routeId("foo")
                    .aggregate(constant(true), new UseLatestAggregationStrategy()).completionTimeout(1000)
                        .to("mock:result");
            }
        };
    }
View Full Code Here

        if (strategyRef != null) {
            aggregationStrategy = routeContext.mandatoryLookup(strategyRef, AggregationStrategy.class);
        }
        if (aggregationStrategy == null) {
            // default to use latest aggregation strategy
            aggregationStrategy = new UseLatestAggregationStrategy();
        }

        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, this, isParallelProcessing());
        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Multicast", this, isParallelProcessing());
View Full Code Here

    }

    static class AggreagateRoute extends RouteBuilder {
        public void configure() throws Exception {
            from("seda:foo4")
                .aggregate(constant("messageId"), new UseLatestAggregationStrategy()).completionTimeout(1000L).
                    to("seda:aggregated");
        }
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.