我的用例需要使用 smne 数据丰富我的输入并将其发送到出站端点。
通过调用两个 Web 服务获取用于丰富的数据,然后从回复中提取数据。此提取的数据被丰富到我的输入 XML 中并发送到出站端点。
我需要进行的两个 Web 服务调用需要并行,因为它们不依赖于另一个。这样我可以节省我的处理时间。
请建议我如何在 Mule 的流程中实现这种并行处理。
注意:我尝试过使用 ALL 流控制,但似乎是按顺序调用 Web 服务(子流)。
下面给出的是我的抽象流程。
<flow name="mainFlow">
<inbound-endpoint> .....
<some validation>
<setting some flow variables>
<!-- Now make calls to the sub-flows which has some processing of the input and make some web-service calls -->
<all>
<flow-ref name="myFlow1" />
<flow-ref name="myFlow2" />
<flow-ref name="myFlow3" />
</all>
<enrich the input with the data obtained from the output of the above three flows>
<outbound-endpoint>
</flow>
<flow name="myFlow1">
<some transformer to transform the payload provided >
< the tran sformed payload is passed as input to the web-service call>
<http:outbound-endpoint ...>
<transform the reply from the web-service call>
</flow>
<flow name="myFlow2">
<some transformer to transform the payload provided >
< the tran sformed payload is passed as input to the web-service call>
<http:outbound-endpoint ...>
<transform the reply from the web-service call>
</flow>
<flow name="myFlow3">
<some transformer to transform the payload provided to it>
< the tran sformed payload is passed as input to the web-service call>
<http:outbound-endpoint ...>
<transform the reply from the web-service call>
</flow>