Examples of UseLatestAggregationStrategy


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 configured
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();
        }
        threadPoolExecutor = createThreadPoolExecutor(routeContext);
        return new Splitter(getExpression().createExpression(routeContext), childProcessor, aggregationStrategy,
                isParallelProcessing(), threadPoolExecutor, streaming);
    }
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

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

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

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

        executorService = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Multicast", this, isParallelProcessing());

        long timeout = getTimeout() != null ? getTimeout() : 0;
View Full Code Here

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

        return new RouteBuilder() {
            public void configure() throws Exception {
                getContext().setTracing(true);
               
                from("seda:splitted").
                    aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(1000L).
                    to("mock:foo").
                    to("mock:result");

                from("timer://kickoff?delay=100&period=9999910000").
                    setHeader("id").constant("foo").setBody().constant("a b c").
View Full Code Here

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

                context.getExecutorServiceManager().registerThreadPoolProfile(profile);
               
                for (int i = 0; i < NUM_AGGREGATORS; ++i) {
                    from("direct:start" + i)
                        // aggregate timeout after 3th seconds
                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000).timeoutCheckerExecutorServiceRef("MyThreadPool")
                        .to("mock:result" + i);
                }
            }
        };
    }
View Full Code Here

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

    }

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