1

I can use an aggregator with completionSize and completionTimeout as below:

    from("direct:aggregate")
    .routeId("aggregate")
    .aggregate(constant(true), new JSONAggregator())
        .completionSize(500)
        .completionTimeout(3000)
        .convertBodyTo(String.class)
        .log("${body}")
    .end();

However, when I use an aggregationStrategy in conjunction with a splitter, I do not get these options. How can I implement aggregator options with a splitter?

Sneharghya Pathak
  • 990
  • 1
  • 9
  • 19
  • Could you add to the question what you think the code should be (including the split)? I just want to see what you're expecting to work – Sam Aug 14 '20 at 12:18
  • @Sam i am hoping for some way to provide these options when doing a split aggregate! – Sneharghya Pathak Aug 17 '20 at 14:28

1 Answers1

2

You can't use these options with the Split EIP. The Splitter combined with an aggregation strategy simply re-aggregates all the parts of the input message it has splitted before.

Example: Split a message with 5000 lines, transform each line and re-aggregate these lines according to the strategy.

Because the aggragtion size is defined by the input message, you can't use any other aggregate completion options.

However, what you can do is, to use the Split EIP without aggregation strategy followed later in the processing by an independant Aggregate EIP. Then you can configure the aggregator as you like.

burki
  • 6,741
  • 1
  • 15
  • 31