简体   繁体   English

Mule ESB中的自定义聚合

[英]Custom aggregation in Mule ESB

I have the following use case in Mule ESB - 我在Mule ESB中有以下用例-

  1. Expose a SOAP endpoint 公开SOAP端点
  2. Depending on a attribute in the SOAP request do conditional routing 根据SOAP请求中的属性进行条件路由
    a. 一种。 If the parameter value is 'a' then get response from one outbound webservice 如果参数值为“ a”,则从一个出站Web服务获取响应
    b. If parameter value is 'b' then get responses from multiple outbound services and aggregate them using a custom aggregation. 如果参数值为“ b”,则从多个出站服务获取响应,并使用自定义聚合对其进行聚合。

How do i go about doing this using Mule ESB? 我该如何使用Mule ESB做到这一点?

well I suggest to take a look about scatter gather component, it would be nice for what you need. 好吧,我建议您看一下散点收集组件,这将非常适合您的需求。

you could read about this in the folowing link: https://docs.mulesoft.com/mule-user-guide/v/3.6/scatter-gather 您可以在以下链接中阅读有关此内容的信息: https ://docs.mulesoft.com/mule-user-guide/v/3.6/scatter-gather

The main idea is to do something like this: 主要思想是做这样的事情:

<scatter-gather doc:name="Scatter-Gather">
        <processor-chain>
            <flow-ref name="getUnitedFlightsFlow" doc:name="getUnitedFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
        <processor-chain>
            <flow-ref name="getDeltaFlightsFlow" doc:name="getDeltaFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
        <processor-chain>
            <flow-ref name="getAmericanFlightsFlow" doc:name="getAmericanFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
    </scatter-gather>

in this example I use the component to take a choice and call a subflow to execute one particular dutty for one of each. 在此示例中,我使用该组件进行选择,并调用一个子流为每个组件执行一个特定的dutty。

I hope this help you. 希望对您有所帮助。

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

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