Hi,
I'm trying to get an aggregator to work in Camel 2.11.0 and am experiencing
difficulties in doing so.
I have defined a main and error route. The main route looks like this:
routeBuilder.from(input).routeId("Main")
.onCompletion().beanRef("myStrategy", "setCompleted").end()
.onException(Exception.class).maximumRedeliveries(0).handled(false).end()
... do stuff...
The error route looks like this:
routeBuilder
.from(input)
.aggregate(new MyStrategy())
.constant(true)
.completionPredicate(
new BeanExpression("myStrategy", "isCompleted"))
... do stuff...
(I want to aggregate everything received in the error route, hence the
".constant(true)")
The MyStrategy class implements AggregationStrategy and has a boolean field,
default value false. This is set to true when setCompleted() is called. The
isCompleted() method returns the value of the boolean field.
I've written a JUnit test which includes a scenario where the error route is
used. However, the setCompleted() method is never called so the test
finishes without the aggregation completing.
Thanks for any assistance.
I'm trying to get an aggregator to work in Camel 2.11.0 and am experiencing
difficulties in doing so.
I have defined a main and error route. The main route looks like this:
routeBuilder.from(input).routeId("Main")
.onCompletion().beanRef("myStrategy", "setCompleted").end()
.onException(Exception.class).maximumRedeliveries(0).handled(false).end()
... do stuff...
The error route looks like this:
routeBuilder
.from(input)
.aggregate(new MyStrategy())
.constant(true)
.completionPredicate(
new BeanExpression("myStrategy", "isCompleted"))
... do stuff...
(I want to aggregate everything received in the error route, hence the
".constant(true)")
The MyStrategy class implements AggregationStrategy and has a boolean field,
default value false. This is set to true when setCompleted() is called. The
isCompleted() method returns the value of the boolean field.
I've written a JUnit test which includes a scenario where the error route is
used. However, the setCompleted() method is never called so the test
finishes without the aggregation completing.
Thanks for any assistance.