私は交換メッセージ本文(MyCustomClassオブジェクトのリスト)を分割し、それらを(1つずつ)処理し、すべての交換をまとめてまとめたいと思います。分割は大丈夫ですが、1つずつ処理しても大丈夫ですが、集計する方法はわかりません。Apache Camelの分割と集計
from("mysource")
.unmarshal(new ListJacksonDataFormat(MyClass.class))
.split().body()
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
// process MyClass item
exchange.getIn().setBody(processedItem);
}
})
.to("destinationForProcessedItem")
.aggregate(new GroupedExchangeAggregationStrategy()) <== Seems like problem is here
.process(new Processor() {
// handle result of aggregation
})
複雑な集約は必要ありません。分割されたExchangeのリストを収集し、最終的なプロセッサで処理するだけです。のみスプリッタを用い例というタイトルのセクションでhttp://camel.apache.org/composed-message-processor.html:この