Monday, October 26, 2015

How to use property mediator in WSO2 ESB

WSO2 ESB provides Property mediator to use is in your code. It is like a variable in programming language. You can set a value into it or also you can remove value from it. If you have enabled the logs, you can see the property variable’s value coming into the logs at what stage what value is assigned for this this variable.

To use a property mediator you can edit a sequence and go to ‘’Add Child then Core then Property mediator as mentioned below.

You will get a below screen in which you can pass the property name, Action (Add or Remove) property type (String, Boolean, Integer, float, long etc.)

  • In Action you can set or remove a value of the property
  • In Set Action as : you can assign a value or can get a value from the expression
  • You can also get a value from other property by using expression="get-property('symbol')" expression.

You can see the property mediator value by putting logs in synapse.