Mule exception strategy does not stop flow from processing

╄→尐↘猪︶ㄣ 提交于 2019-12-11 09:27:26

问题


I've the following scenario. If for some reason the FTP upload fails (in this case I entered wrong credentials), the catch exception strategy is called correctly, but I still see the message Upload complete. in my log files.

Why does the flow continue its execution after an exception occurs?

<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>

回答1:


Because the incoming MuleEvent is asynchronous. Try setting the processiingStrategy="synchronous" on theflow:

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


来源:https://stackoverflow.com/questions/29793466/mule-exception-strategy-does-not-stop-flow-from-processing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!