Search in sources :

Example 6 with UseLatestAggregationStrategy

use of org.apache.camel.processor.aggregate.UseLatestAggregationStrategy in project camel by apache.

the class AggregatorExceptionTest method createRouteBuilder.

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {

        @Override
        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);
                }
            });
        }
    };
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) RouteBuilder(org.apache.camel.builder.RouteBuilder) UseLatestAggregationStrategy(org.apache.camel.processor.aggregate.UseLatestAggregationStrategy)

Example 7 with UseLatestAggregationStrategy

use of org.apache.camel.processor.aggregate.UseLatestAggregationStrategy in project camel by apache.

the class EnricherRefTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("cool", cool);
    jndi.bind("agg", new UseLatestAggregationStrategy());
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) UseLatestAggregationStrategy(org.apache.camel.processor.aggregate.UseLatestAggregationStrategy)

Example 8 with UseLatestAggregationStrategy

use of org.apache.camel.processor.aggregate.UseLatestAggregationStrategy in project camel by apache.

the class PollEnricherRefTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("cool", cool);
    jndi.bind("agg", new UseLatestAggregationStrategy());
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) UseLatestAggregationStrategy(org.apache.camel.processor.aggregate.UseLatestAggregationStrategy)

Aggregations

UseLatestAggregationStrategy (org.apache.camel.processor.aggregate.UseLatestAggregationStrategy)8 RouteBuilder (org.apache.camel.builder.RouteBuilder)6 Exchange (org.apache.camel.Exchange)5 Processor (org.apache.camel.Processor)3 JndiRegistry (org.apache.camel.impl.JndiRegistry)2 AggregationStrategy (org.apache.camel.processor.aggregate.AggregationStrategy)2 Expression (org.apache.camel.Expression)1 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)1