The RMSequence Mediator can be used to create a sequence of messages to communicate via WS-Reliable Messaging with a WS-RM enabled endpoint (<
enableRM>). The simple use case of this Mediator is to specify a
single="true" property, because this means that 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 a unique element value from the incoming message. With the result of the XPath expression, Synapse can group together messages that belong to the same sequence. To close the sequence neatly, the last message of the sequence (also an XPath expression) should be specified. The WS-RM specification version to be used can be specified as 1.0 or 1.1 with the version attribute.
- WS-RM Spec Version - Reliable Messaging Specification version: possible values are 1.0 /1.1.
- Message Sequence - Whether to use a single message or 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 fields which appear in the panel.
- Sequence XPath - The XPath expression that selects a unique element value from the incoming message.
- Last Message XPath - The XPath expression that identifies the last message.
You can click the Namespaces 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.
You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.
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 a single message per sequence. It also specifies the version of the WS-RM to be used.