Monday, February 29, 2016

Property Mediator - WSO2 ESB

Hi all,

Property mediator is another special mediator in WSO2 ESB. Property Mediator will not change message which will flow through ESB. But it has special qualities like retrieve properties set on message context. It is very useful as we check message properties with given commands.

Property mediator is conditionally content aware mediator. That means, it will not know message context without giving proper commands. We can give commands to see content and get action upon that.

Can retrieve properties using
      get-property(prop-name)
      
When defining this function, it has to be identify relevant scope. If a property has no defined scope, it defaults to the Synapse message context scope.

General syntax for property mediator.

<property name="string" [action=set|remove] [type="string"] (value="literal" | expression="xpath") [scope=default|transport|axis2|axis2-client] [pattern="regex" [group="integer"]]>
<xml-element/>
?
</property>

Ex:
<?xml version="1.0" encoding="UTF-8"?>
<property xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('axis2','jms.message.delivery.count')" name="JMSXDeliveryCount" scope="default" type="INTEGER" />
              

Refere WSO2 Documentation if you keen to know parameters and to get more knowledge :)
Link: https://docs.wso2.com/display/ESB490/Property+Mediator

Note: Remember functionality of property mediator and different properties which can defined through its scope. It is a sure thing, that u will need "property mediator" if u are an ESB user :)

Waiting for value additions :)

No comments:

Post a Comment