The below markup is my iterate mediator which is inside a proxy service set up within WSO2 ESB 4.9.0.
I'm attempting to loop through an array of form submissions and POST them into a RESTful API also defined within the ESB. However, even though I'm using the CALL mediator, the API logs show that all my iterate requests are firing milliseconds apart - which to me indicates that the iterate mediator is actually running my inline target sequence asynchronously despite setting sequential="true".
Is there any way to ensure that the call to my REST API completes before iterating and submiting another request?
<iterate continueParent="true"
id="IterateRequestSink"
expression="//*[local-name()='Submission']"
sequential="true">
<target>
<sequence>
<property name="DISABLE_CHUNKING"
value="true"
scope="axis2"
type="STRING"/>
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
<payloadFactory media-type="xml">
<format>
<params xmlns="">
<description>$1</description>
<return_call>$2</return_call>
<mobile>$3</mobile>
<sub_category>$4</sub_category>
<first_name>$5</first_name>
<last_name>$6</last_name>
<category>$7</category>
</params>
</format>
<args>
<arg evaluator="xml" expression="//*[local-name()='description']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='return_call']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='mobile']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='sub_category']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='first_name']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='last_name']/text()"/>
<arg evaluator="xml" expression="//*[local-name()='category']/text()"/>
</args>
</payloadFactory>
<property name="messageType"
value="application/x-www-form-urlencoded"
scope="axis2"
type="STRING"/>
<call>
<endpoint>
<address uri="http://localhost:8280/crm/request" format="rest"/>
</endpoint>
</call>
<log level="full"/>
</sequence>
</target>
</iterate>