Title: Proposal for <switch/> mediator

Let's start with the syntax

<switch >
       <xpath/>*
       <regex/>*
</switch>

Note: "*" means 0 or N number of mediators.

Description:

All the mediators available in Synapse, <regex/> and <xpath/> can be considered as the conditional mediators and all other mediators are static and guarantee of doing some mediation work in line.

Say a scenario as follows,

<switch>
      <xpaht dosomething1/>
      <regex dosomething2/>
      <regext dosomething3/>
      <xpath dosomething4/>
</switch>

So if <regex dosomething2/> is passed, all the other mediators thereafter will be ignored. So "exactly one" mediator <regex/> or <xpath/> will be invoked.

The possible disadvantage is, there is no default mediator to execute, if all the mediators in the list failed. Since all <switch/> can include <xpaths/>'s and <regex/>'s.

I feel this is as a "extension" to Synapse rather being core feature.

Please comment.

Thank you

Saminda









Reply via email to