【发布时间】: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>
【问题讨论】: