Nita
Nita

Reputation: 141

Synchronous Call in WSO2 ESB in iterator mediator

Is there any way to make synchronous call of all the codes written inside the iterator mediator in esb wso2?

Upvotes: 3

Views: 452

Answers (3)

Madhushani Hewagama
Madhushani Hewagama

Reputation: 468

For this you can use iterator mediator with sequential="true" and call mediator blocking = "true" or "false" upon your requirement both these are synchronous calls. If you want to know more details about call mediator with blocking and non-blocking please refer this WSO2 Call (Blocking vs Non-blocking) vs Send Mediators

<iterate expression="input your array xpath" id="sampleIterator" sequential="true">
    <target>
        <sequence>
           // your sequence logic here
            // if call the endpoint in with blocking="true"
            <call blocking="true">
                <endpoint key="endpoint-name"/>
            </call>

           // if call the endpoint in with blocking="false"
            <call>
                 <endpoint key="endpoint-name"/>
            </call>

        <sequence>
    </target>
</iterate>

Upvotes: 2

Nita
Nita

Reputation: 141

Finally, it is working by doing two things together. Set sequential="true" in iterator and in call mediator use blocking = "true"

Upvotes: 1

Bee
Bee

Reputation: 12513

Are you using send mediator? If yes, use call mediator instead, which is synchronous.

Upvotes: 1

Related Questions