This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Clone Mediator

The Clone Mediator can be used to clone a message into several messages.

The Clone Mediator closely resembles the Message Splitter EIP and will split the message into number of identical messages which will be processed in parallel. The original message cloned can be continued or dropped depending on the boolean value of the optional continueParent attribute. Optionally, a custom To address and/or an soapAction may be specified for cloned messages.



Syntax

<clone [continueParent=(true | false)]>
   <target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"] [endpoint="endpoint_ref"]>
     <sequence>
       (mediator)+
     </sequence>?
     <endpoint>
       endpoint
     </endpoint>?
   </target>+
 </clone>

UI Configuration

The Clone Mediator Field Descriptions
  • Continue Parent
    • Yes - The original message will be continued.
    • No - The original message will be dropped.
  • Number of clones - Number of clones created.

    Tip

    Number of clones can be controlled by adding one or more clone targets by clicking on the "Add Clone Target" link. Targets can then have it's own set of mediators.

The "Target Configuration" Window of the Mediator

Here you can prepare a message to send to an endpoint or mediate through some more sequences.

  • SOAP Action - The SOAP action of the message.
  • To Address - The target endpoint address.
  • Sequence - Mediate 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 - Send the message to an endpoint. Here you can pick a named endpoint from the registry or keep the endpoint as anonymous.

    Tip

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

Note

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


Example

<clone xmlns="http://ws.apache.org/ns/synapse">
   <target>
      <endpoint name="endpoint_urn_uuid_73A47733EB1E6F30812921609540392-849227072">
         <default />
      </endpoint>
   </target>
   <target sequence="test1" />
</clone>

In this example, the Clone Mediator clones messages and redirects them to a Default Endpoint and an existing sequence.