Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The optional id attribute can be used to identify the iterator which created a particular split message when nested iterate mediators are used. This is particularly useful when aggregating responses of messages that are created using nested iterate mediators.

...

Table of Contents
maxLevel3
minLevel3
locationtop
styleborder:1

...

typeflat
separatorpipe

...

Syntax

Code Block
XML
XML

<iterate<iterate [sequential=(true | false)] [continueParent=(true | false)] [preservePayload=(true | false)] (attachPath="xpath")? expression="xpath">
   <target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"] [endpoint="endpoint_ref"]>
     <sequence>
       (mediator)+
     </sequence>?
     <endpoint>
       endpoint
     </endpoint>?
   </target>+
</iterate>

...

  • Iterate ID - Can be used to identify messages created by the iterate mediator. Useful when defining nested iterate mediators.
  • Sequential Mediation - Specifies whether split messages should be processed sequentially (True) or in parallel (False). Default value is "false" (parallel processing).
  • Continue Parent - Specifies whether the original message should be continued or dropped.
    • True
    • False

      Info
      titleTip

      This is default to false.

  • Preserve Payload - Specifies whether the original message should be used as a template when creating the split messages.
    • True
    • False

      Info
      titleTip

      This is default to false.

  • Iterate Expression - XPath expression that matches the elements, which you want to split the message from.
  • Attach Path - To form new messages, you can specify an XPath expression for elements that the split elements are attached to (as expressed in Iterate expression).

...

  • SOAP Action - The SOAP action of the message.
  • To Address - The target endpoint address.
  • Sequence - Mediates the message through a sequence. You can either pick a named sequence from the registry or define an anonymous sequence by adding mediators to the current Target mediator as children.
  • Endpoint - Sends the message to an endpoint. Here you can pick a named endpoint from the registry or keep the endpoint as anonymous.

    Info
    titleTip

    You can add in the Endpoint panel that can be accessed from the Manage-> Mediation-> Endpoints menu in the left hand side menu bar.

Info
titleNote

You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.

...

Example

Code Block
XML
XML

<iterate expression="//m0:getQuote/m0:request" preservePayload="true"
         attachPath="//m0:getQuote"
         xmlns:m0="http://services.samples">
    <target>
        <sequence>
            <send>
                <endpoint>
                    <address
                        uri="http://localhost:9000/services/SimpleStockQuoteService"/>
                </endpoint>
            </send>
        </sequence>
    </target>
</iterate>

In this scenario, the Iterate Mediator splits the messages in to parts and processes them asynchronously.

Excerpt
hiddentrue

Description of the Iterate Mediator in WSO2 ESB.