Iterate mediator in now working sequentially with sequential="true"

29 views Asked by At

I have this input

<uList>
    <user>
      <id>12</id>
    </user>
    <user>
      <id>13</id>
    </user>
    <user>
      <id>14</id>
    </user>
    <user>
      <id>15</id>
    </user>
</uList>

I want to iterate this list and call to scim GET API. But I want to do this in sequentially. (One by one API call)

I used below iterate mediator. But still it is working in parallel. What is the issue here?

 <iterate expression="//*[local-name()='user']" sequential="true">
              <target>
                 <sequence>
                    <property name="uri.var.uuid" expression="//*[local-name()='scimId']" scope="default" type="STRING"/>
                    <log level="custom">
                       <property name="uri.var.uuid" expression="//*[local-name()='scimId']"/>
                    </log>
                    <property name="NO_ENTITY_BODY" value="true" scope="axis2" type="BOOLEAN"/>
                    <header name="Content-Type" scope="transport" action="remove"/>
                    <call>
                       <endpoint>
                          <http method="GET" uri-template="https://run.mocky.io/v3/ebc2eef8-6012-4fbb-b0b5-d063b68c6400"/>
                       </endpoint>
                    </call>
                    <property name="userName" expression="json-eval($.userName)" scope="default" type="STRING"/>
                    <payloadFactory media-type="json">
                       <format>{"responses":{ "username":"$1", "scimId":"$2"}}</format>
                       <args>
                          <arg evaluator="xml" expression="$ctx:userName"/>
                          <arg evaluator="xml" expression="$ctx:uri.var.uuid"/>
                       </args>
                    </payloadFactory>
                    <script language="js">java.lang.Thread.sleep(5000);</script>
                 </sequence>
              </target>
           </iterate>
1

There are 1 answers

2
ycr On

Try doing a blocking call by setting the flag blocking="true" in the Call Mediator.

<call blocking="true">
   <endpoint>
      <address uri="http://localhost:9000/services/SimpleStockQuoteService" />
   </endpoint>
</call>