As the name suggests clone meditor can be used to clone a message in to 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. They can also be set to process sequentially by setting the value of the optional 'sequential' attribute to 'true'. 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 a 'Action' may be specified for cloned messages. The optional 'id' attribute can be used to identify the clone mediator which created a particular splitted message when nested clone mediators are used. This is particularly useful when aggregating responses of messages that are created using nested clone mediators.
<clone [id="id"] [continueParent=(true | false)] [sequential=(true | false)]> <target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"] [endpoint="endpoint_ref"]> <sequence> (mediator)+ </sequence>? <endpoint> endpoint </endpoint>? </target>+ </clone>
Figure 1: Clone mediator options
Clone mediator field descriptions,
Figure 2: Adding a clone target
For more information about target refer Target.
<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 redirect them two a default endpoint and an existing sequence.