【问题标题】:Mule exception strategy does not stop flow from processingMule 异常策略不会停止处理流程
【发布时间】:2017-01-06 07:55:30
【问题描述】:

我有以下情况。如果由于某种原因 FTP 上传失败(在这种情况下我输入了错误的凭据),则正确调用了 catch 异常策略,但我仍然在我的日志文件中看到消息 Upload complete.。

为什么发生异常后流程会继续执行?

<flow name="mainFlow" doc:name="mainFlow">
    <vm:inbound-endpoint path="test" exchange-pattern="one-way" />

    <choice>
        <when expression="#[flowVars.fileToUpload != null]">
            <set-payload value="#[flowVars.fileToUpload]" /> 
            <ftp:outbound-endpoint host="${ftp.host}" port="${ftp.port}" user="${ftp.username}" password="${ftp.password}" path="${ftp.path.input}"  outputPattern="#[flowVars.fileName]" /> 
        </when>
        <otherwise>
            <logger doc:name="Logger"/>
        </otherwise>
    </choice>

    <logger message="Upload complete." level="INFO" />

    <catch-exception-strategy>
        <logger doc:name="Exception occurred"/>
    </catch-exception-strategy>
</flow>

【问题讨论】:

    标签: ftp mule esb


    【解决方案1】:

    因为传入的 MuleEvent 是异步的。尝试在流程上设置 processiingStrategy="synchronous":

    <flow name="mainFlow" doc:name="mainFlow" processingStrategy="synchronous">
        ....
    </flow>
    

    【讨论】:

      猜你喜欢
      • 2023-03-04
      • 1970-01-01
      • 2014-03-26
      • 2011-01-23
      • 1970-01-01
      • 2016-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多