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>
Because the incoming MuleEvent is asynchronous. Try setting the processiingStrategy="synchronous" on theflow: