In WSO2 ESB, can i use aggregate mediator to aggregate messages split by iterate mediator(which doesn't use Send or Call mediators to send the message to external endpoint) ?
I have tried this but aggregate mediator is not picking up the split messages..
Any help is deeply appreciated .
Asked
Active
Viewed 1,353 times
3
2 Answers
3
I've had to do the same thing and can tell that it works if you define a fake response :
iterate -> sequence
- apply any needed transformations to your message
- define it as a response message (set property RESPONSE to true)
- call a sequence containing aggregate mediator
aggregate
- completeCondition : set min and max messageCount to -1
- onComplete : you will receive all your fragments as soon as iterate will have process all concerned nodes

Jean-Michel
- 5,926
- 1
- 13
- 19
-
Thanks for response. I tried setting RESPONSE property to true. But it didn't work. FYI my aggregate mediator is placed just after the iterate mediator. – Pawandeep Nov 07 '16 at 06:25
-
Also, is it necessary to call a sequence containing aggregate mediator from within the iterate mediator ? i am using id of iterate mediator in aggregate mediator.. – Pawandeep Nov 07 '16 at 06:51
-
the sequence of mediation inside iterate mediator is executed in a new thread. As far as I know, you cannot not have your aggregate to operate after iterate, in the parent thread so yes, you should call a sequence containing your aggregate from inside the iterate mediator. – Jean-Michel Nov 07 '16 at 08:14
0
If you are only trying to transform a message iteratively, then you can use the ForEach mediator without the need for Iterate and Aggregate mediators. This is supported since ESB 4.9.0

maheeka
- 1,983
- 1
- 17
- 25
-
Actually i am calling an extrenal endpoint conditionally in my iterator. i.e. for some iterations endpoint will be called, for others it won't be called. As you know it is not possible to call endpoint in foreach mediator. – Pawandeep Nov 07 '16 at 06:27