【发布时间】:2016-05-26 01:23:53
【问题描述】:
我是 mule 新手,请帮助我了解这个逻辑。实际上,在我的流程中,我有选择消息处理器,不满足的表达式将默认选择。之后我有流量参考。 我不希望消息进入默认(选择)必须填充到流引用。相反,它必须转到我在该流中配置的选择异常策略。 所以我需要默认抛出一些异常。 其实我有一个很大的流量,我让它很容易理解。请通过xml配置查找。
<flow name="Choice" doc:name="Choice">
<file:inbound-endpoint path="C:\Users\Star\Desktop\Mule\FilePath1" responseTimeout="10000" doc:name="File"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<choice doc:name="Choice">
<when expression="#[xpath('fn:local-name(/root/*[2])')=='book']">
<file:outbound-endpoint path="C:\Users\Star\Desktop\Mule\FilePath2" responseTimeout="10000" doc:name="File"/>
</when>
<otherwise>
<file:outbound-endpoint path="C:\Users\Star\Desktop\Mule\FilePath3" responseTimeout="10000" doc:name="File"/>
</otherwise>
</choice>
<flow-ref name="SampleService" doc:name="Flow Reference"/>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<logger message="*****#[exception]****" level="INFO" doc:name="Logger"/>
</catch-exception-strategy>
</flow>
<flow name="SampleService" doc:name="SampleService">
<file:inbound-endpoint path="C:\Users\Star\Desktop\Mule\FilePath4" responseTimeout="10000" doc:name="File"/>
</flow>
请建议我在 Mule 中抛出异常的任何标准方法。我也尝试保留
<test:component throwException="true"/>
但它会抛出异常,例如 - “元素“test:component”的前缀“test”未绑定”。
【问题讨论】:
标签: mule mule-studio mule-el