Mule 异步块使内部的所有流引用异步?

Mule 异步块使内部的所有流引用异步?,mule,Mule,考虑以下情况: 我有一个Web服务,它开始从源文件导入内容。我想在电话被接听后尽快回复来电者200 OK。 很少有不同的流需要以正确的顺序执行 <flow name="startImport" > <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="startImport"/> <async>

考虑以下情况: 我有一个Web服务,它开始从源文件导入内容。我想在电话被接听后尽快回复来电者200 OK。 很少有不同的流需要以正确的顺序执行

<flow name="startImport" >
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="startImport"/>
        <async>
            <flow-ref name="Country" />
            <flow-ref name="Account" />
            <flow-ref name="Contact" />
        </async>
</flow>

嗯,这不起作用,因为所有流都是同时执行的

用这样的另一个流来包装它怎么样

<flow name="startImport" >
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="startImport"/>
        <async>
            <flow-ref name="startImport2" />
        </async>
</flow>

<flow name="startImport2" processingStrategy="synchronous" >
        <processor-chain>
            <flow-ref name="Country" />
            <flow-ref name="Account" />
            <flow-ref name="Contact" />
        </processor-chain>
</flow>

不,还是一样的结果


如何阻止async块使所有其他流引用也变为async?我只希望第一次调用异步启动

最后,我删除了流引用并使用vm端点,如下所示:

<flow name="startImport" >
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="startImport"/>
        <async>
            <vm:outbound-endpoint exchange-pattern="one-way"  doc:name="VM" path="import-all.service.in"/>
        </async>
</flow>

<flow name="startImport2" processingStrategy="synchronous" >
      <vm:outbound-endpoint exchange-pattern="one-way"  doc:name="VM" path="import-all.service.in"/>
      <flow-ref name="Country" />
      <flow-ref name="Account" />
      <flow-ref name="Contact" />
</flow>


现在它的工作方式与我期望的一样,它从调用中快速返回,并让异步流完成繁重的工作。

通过
flow ref
调用的私有流将获取飞行中事件的同步性

要更改这一点,您可以更改要同步执行的流的
processingStrategy
。例如:

<flow name="Country" processingStrategy="synchronous">

</flow>