camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gershaw, Geoffrey A. " <geoffrey.gers...@credit-suisse.com>
Subject Splitter Question
Date Wed, 04 Jan 2017 23:01:41 GMT
Hi All,

I am on version 2.17 and am splitting a json document and passing bits of json to a processor.
If the processing bean returns null, I want to keep iterating. If the processing bean returns
a Widget, I would like to stop iterating and have the old exchange contain the Widget. I believe
I need an aggregator to detect when its time to aggregate and to copy the widget from the
new exchange to the old exchange.

The below doesn't run. Error is : Definition has no children on Aggregate[true -> []].
I think this is because I don't have any endpoints between aggregate and end.

I'm sure I'm doing something simple wrong. Any advice would be appreciated.


.split().jsonpath("$.[*]")
    .bean(WidgetProcessingBean.class)
    .aggregate(constant(true), new DummyAggregationStrategy()).eagerCheckCompletion()
        .completionPredicate(body().isNotNull()))
    .end()
.end()
.choice()
    .when(body().isInstanceOf(Widget.class))
        .log("Widget found")
    .otherwise()
        .log("Widget not found")
.end()

Thanks,
Geoff

=============================================================================== 
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=============================================================================== 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message