简体   繁体   English

如何在wso2 esb中使用ConditionalRouter介体

[英]How to use ConditionalRouter mediator in wso2 esb

I need to call different sequence according to some number range( Here is technical purpose). 我需要根据一些数字范围调用不同的序列(这是技术目的)。 Here is my condition 这是我的情况

Case 01. 案例01。

number = 100  then call  sequence01

Case 02 案例02

100<number<200 then call sequence2

Case 03 案例03

200<number<300 then call sequence3

I tried with using Filter mediator . 我尝试使用过滤器介体 But it's big code. 但这是很大的代码。 I need to do this with some simple way more than filter mediator. 我需要通过一些简单的方法来完成此任务,而不仅仅是过滤器中介器。 I tried to use ConditionalRouter mediator to do this task according to this documentation. 我试图根据文档使用ConditionalRouter中介程序来执行此任务。 But I don't have idea how to apply this to my task. 但是我不知道如何将此应用于我的任务。 Can I use ConditionalRouter mediator to solve my task. 我可以使用ConditionalRouter中介程序解决我的任务。

You should be able to easily achieve this by using the switch mediator . 您应该能够使用switch中介器轻松实现此目的。

<switch source="get-property('propertyCotainingValue')">
               <case regex="\d\d">
                  <!-- call sequence 1-->
               </case>
               <case regex="1\d\d">
                    <!-- call sequence 2-->
               </case>
               <case regex="2\d\d">
                    <!-- call sequence 3-->
               </case>
               <default>
               </default>
            </switch>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM