The RMSequence Mediator can be used to create a sequence of messages to communicate via WS-Reliable Messaging with an WS-RM enabled endpoint (<enableRM
>). The simple use case of this Mediator is to specify a single="true"
property, because this means that the only one message is involved in the same sequence. However, if multiple messages should be sent in the same sequence, the correlation property should be used with a XPath expression that selects an unique element value from the incoming message. With the result of the XPath expression, Synapse can group messages together that belong to the same sequence. To close the sequence neatly, for the last message of the sequence also an XPath expression should be specified. With the version attribute the WS-RM specification version to be used can be specified 1.0 or 1.1.
Syntax
<RMSequence (correlation="xpath" [last-message="xpath"]) | single="true" [version="1.0|1.1"]/>
UI Configuration
- WS-RM Spec Version - Reliable Messaging Specification version: possible values 1.0 /1.1.
- Message Sequence - Whether to use a single message or a multiple correlated messages.
- Single Message - Makes single message reliable.
- Correlated Sequence - Makes multiple correlated message reliable. When you select this option you have to provide the following two fields appears in the panel.
- Sequence XPath - The XPath expression that selects an unique element value from the incoming message.
- Last Message XPath - The XPath expression that identifies the last message.
Tip
You can click this link to add namespaces if you are providing an expression. You will be provided another panel named "Namespace Editor," where you can provide any number of namespace prefixes and URL that you have used in the XPath expression. See Common Screens and Dialog Boxes.
Note
You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.
Example
<in> <RMSequence single="true" version="1.0"/> <send> <endpoint name="reliable"> <address uri="http://localhost:9000/services/ReliableStockQuoteService"> <enableRM/> <enableAddressing/> </address> </endpoint> </send> </in>
In the above scenario, WS-RM is engaged to the endpoint using the <enableRM/
> tag. It is possible to engage WS-RM to both Address and WSDL Endpoints using this tag. In addition to the RM enabled endpoint, RMSequence Mediator is specified before the Send Mediator. This Mediator is used to specify the set of messages to be sent using a single RM sequence. In this sample, it is specified as single message per sequence. It also specifies the version of the WS-RM to be used.