Package org.apache.camel.processor.aggregate

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


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


        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("timer:foo")
                    .bean(BigPayload.class)
                    .aggregate(method(HawtDBBigPayloadTest.class, "number"), new UseLatestAggregationStrategy())
                        .aggregationRepository(repo)
                        .completionSize(2).completionTimeout(5000)
                        .log("Aggregated key ${header.CamelAggregatedCorrelationKey}");
            }
        };
View Full Code Here

        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("timer:foo")
                    .bean(BigPayload.class)
                    .aggregate(method(LevelDBBigPayloadTest.class, "number"), new UseLatestAggregationStrategy())
                        .aggregationRepository(repo)
                        .completionSize(2).completionTimeout(5000)
                        .log("Aggregated key ${header.CamelAggregatedCorrelationKey}");
            }
        };
View Full Code Here

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                errorHandler(deadLetterChannel("mock:failed").maximumRedeliveries(0).handled(false));

                from("direct:seqential").split(body().tokenize(","), new UseLatestAggregationStrategy()).to("mock:result");

                from("direct:parallel").split(body().tokenize(","), new MyAggregationStrategy()).parallelProcessing(true).to("mock:result");

                from("direct:streaming").split(body().tokenize(",")).streaming().to("mock:result");
View Full Code Here

                // 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(),
                    property(Exchange.AGGREGATED_SIZE).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

                from(multicastEndpointUri).to("jms:queue:point1", "jms:queue:point2", "jms:queue:point3");
                from("jms:queue:point1").process(new MyProcessor()).to("jms:queue:reply");
                from("jms:queue:point2").process(new MyProcessor()).to("jms:queue:reply");
                from("jms:queue:point3").process(new MyProcessor()).to("jms:queue:reply");
                from("jms:queue:reply").aggregate(header("cheese"), new UseLatestAggregationStrategy()).completionSize(3)
                    .to("mock:reply");
            }
        };
    }
View Full Code Here

            Object recipient = iter.next();
            Endpoint endpoint = resolveEndpoint(exchange, recipient);
            Producer producer = getProducerCache(exchange).getProducer(endpoint);
            processors.add(producer);
        }
        MulticastProcessor mp = new MulticastProcessor(processors, new UseLatestAggregationStrategy());
        mp.process(exchange);
    }
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

        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 (groupExchanges != null && groupExchanges) {
                // if grouped exchange is enabled then use special strategy for that
                strategy = new GroupedExchangeAggregationStrategy();
            } else {
                // 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.