Examples of UseLatestAggregationStrategy


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

                throw new IllegalArgumentException("Cannot find AggregationStrategy in Registry with name: " + strategyRef);
            }
        }
        if (strategy == null) {
            // fallback to use latest
            strategy = new UseLatestAggregationStrategy();
        }

        if (strategy instanceof CamelContextAware) {
            ((CamelContextAware) strategy).setCamelContext(routeContext.getCamelContext());
        }
View Full Code Here

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

    protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) throws Exception {
        AggregationStrategy strategy = createAggregationStrategy(routeContext);
        if (strategy == null) {
            // default to use latest aggregation strategy
            strategy = new UseLatestAggregationStrategy();
        }

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

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

                throw new IllegalArgumentException("Cannot find AggregationStrategy in Registry with name: " + strategyRef);
            }
        }
        if (strategy == null) {
            // fallback to use latest
            strategy = new UseLatestAggregationStrategy();
        }

        if (strategy instanceof CamelContextAware) {
            ((CamelContextAware) strategy).setCamelContext(routeContext.getCamelContext());
        }
View Full Code Here

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

    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        Processor childProcessor = routeContext.createProcessor(this);
        if (aggregationStrategy == null) {
            aggregationStrategy = new UseLatestAggregationStrategy();
        }
        if (threadPoolExecutor == null) {
            threadPoolExecutor = new ThreadPoolExecutor(4, 16, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
        }
        return new Splitter(getExpression().createExpression(routeContext), childProcessor, aggregationStrategy,
View Full Code Here

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

    protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) {
        if (aggregationStrategy == null && strategyRef != null) {
            aggregationStrategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
        }
        if (aggregationStrategy == null) {
            aggregationStrategy = new UseLatestAggregationStrategy();
        }
        if (threadPoolRef != null) {
            threadPoolExecutor = routeContext.lookup(threadPoolRef, ThreadPoolExecutor.class);
        }
        return new MulticastProcessor(list, aggregationStrategy, isParallelProcessing(), threadPoolExecutor);
View Full Code Here

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

                // create the aggregation collection we will use.
                // - we will correlate the received message based on the id header
                // - as we will just keep the latest message we use the latest strategy
                // - and finally we stop aggregate if we receive 2 or more messages
                AggregationCollection ag = new PredicateAggregationCollection(header("id"),
                    new UseLatestAggregationStrategy(),
                    header(Exchange.AGGREGATED_COUNT).isEqualTo(3));

                // 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 configued
View Full Code Here

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

    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                from("direct:seqential").splitter(body().tokenize(","), new UseLatestAggregationStrategy()).to("mock:result");
                from("direct:parallel").splitter(body().tokenize(","), new MyAggregationStrategy(), true).to("mock:result");
                from("direct:streaming").splitter(body().tokenize(",")).streaming().to("mock:result");
                from("direct:parallel-streaming").splitter(body().tokenize(","), new MyAggregationStrategy(), true).streaming().to("mock:result");
            }
        };
View Full Code Here

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

            Object recipient = iter.next();
            Endpoint<Exchange> endpoint = resolveEndpoint(exchange, recipient);
            Producer<Exchange> producer = producerCache.getProducer(endpoint);
            processors.add(producer);
        }
        MulticastProcessor mp = new MulticastProcessor(processors, new UseLatestAggregationStrategy());
        mp.process(exchange);
    }
View Full Code Here

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

        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

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

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                errorHandler(deadLetterChannel("mock:failed").maximumRedeliveries(0));
                from("direct:seqential").splitter(body().tokenize(","), new UseLatestAggregationStrategy()).to("mock:result");
                from("direct:parallel").splitter(body().tokenize(","), new MyAggregationStrategy(), true).to("mock:result");
                from("direct:streaming").splitter(body().tokenize(",")).streaming().to("mock:result");
                from("direct:parallel-streaming").splitter(body().tokenize(","), new MyAggregationStrategy(), true).streaming().to("mock:result");
                from("direct:exception")
                    .splitter(body().tokenize(","))
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.