The Property Mediator has no direct impact on the message, but rather on the message context flowing through Synapse. You can retrieve the properties set on a message later, through the
synapse:get-property(prop-name) XPath extension function. If a property has a defined scope, you can set it as a transport header property, an (underlying) Axis2 message context property, or as a Axis2 client option. If a property has no defined scope, it defaults to the Synapse message context scope. Using the property element with the action specified as
remove, you can remove any existing message context properties.
The following topics introduce different types of properties and how to configure the property mediator using :
Property mediator configuration
Follow the instructions below to configure Property mediator.
1. Log in to the ESB Management Console and click the Sequences sub menu under Service Bus. Then click the Edit link associated with the sequence you want to edit.
2. The Edit Sequence window opens.
3. Click the Add Child button. A popup menu appears. From that, select Core and then select Property to open the Property Mediator window. (You might have to scroll down to view the window)
You have the following configuration under the Property Mediator.
- Name - A name for the property. You can return the value of the property by calling
get-property(property-name)XPath extension function.
- Action- The action to do. Possible values are:
- Set - Adds a new property.
- Remove - Removes the property with the given name.
- Set Action As- Specifies which type of value to store. Possible values are:
- Value - A static text value.
- Expression - XPath expression to evaluate if there are any namespaces involved in the XPath expression. You can specify it in the Namespace Editor.
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.
- Type- Specifies the type of the property. Property mediator will handle the property as a property of selected type. Possible values are:
The property mediator will consider any property as a STRING type property by default.
- Pattern - Specifies a regular expression that will be evaluated against the value of the property or result of the XPath expression.
- Group - Number (Index) of the matching item evaluated using regular expression given in "Pattern."
- Scope- Specifies the scope the property is valid. Possible values are:
4. Without using the UI, you can also configure the Property mediator using XML. Click the switch to source view link in the Mediator window and provide your configuration code.
Given below is an example configuration of the Property mediator.
In this example, we are setting the property symbol and later we can log it using the Log Mediator.
Given below are descriptions of different types of properties.
For a list of various types of properties supported in the ESB, their descriptions and use cases, refer to our Properties Reference.