我正在解决如下故障安全方案。
但是在恢复流中,我无法获取由于 subflow1 或 subflow2 失败而发生的异常或 exceptionPayload。
有什么办法可以让第一个成功的路由处理器中不成功的消息处理器抛出异常。
我查看了 MuleFirstSuccessful
类代码。从其中的循环中,我可以看到异常被捕获但未保存。
有没有一种方法可以扩展并拥有自己的第一次成功,这也可以为我提供例外?
<flow name="main_flow" >
....
....
<first-successful>
<flow-ref name="subflow_1" />
<flow-ref name="recoveryFlow1" />
</first-successful>
....
....
<first-successful>
<flow-ref name="subflow_2" />
<flow-ref name="recoveryFlow2" />
</first-successful>
....
....
</flow>
<sub-flow name="subflow_1">
....
....
<out-bound call to web-service />
....
....
</sub-flow>
<sub-flow name="subflow_2">
....
....
<out-bound call to web-service />
....
....
</sub-flow>
<sub-flow name="revoceryFlow1" >
<process communication based on the exception thrown by previous unsuccessful sub-flow 1>
<some more processing so that the remaining main flow is not impacted because of the failue of the subflow 1 >
</sub-flow>
<sub-flow name="revoceryFlow2" >
<process communication based on the exception thrown by previous unsuccessful sub-flow 2>
<some more processing so that the remaining main flow is not impacted because of the failue of the subflow 2 >
</sub-flow>
请告知我是否走错了方向。有比我更好的方法吗?