Mule-ESB:基于HTTP状态的Mule筛选器 [英] Mule-ESB: Mule filter based on HTTP Status
本文介绍了Mule-ESB:基于HTTP状态的Mule筛选器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用选择过滤器以外的其他过滤器根据http状态调用子流?
How do I use a filter other than a choice filter to call a subflow based on the http status?
<flow>
<http:outbound-endpoint exhange-pattern="request-response>
if http.status!=201
<flow-ref="subflow-to-invoke">
</flow>
推荐答案
以下是上面链接中的代码段,可以回答您的问题.
Here is snippet from the above link, that answers your question.
<flow>
<http:outbound-endpoint address="${host}" exchange-pattern="request-response"/>
<choice>
<when expression="#[message.inboundProperties['http.status']]==201">
<flow-ref name=="flow2">
</when>
<when expression="#[message.inboundProperties['http.status']]==503">
<flow-ref name="flow3">
</when>
<when expression="#[payload instanceof java.lang.SocketException]">
<flow-ref name="flow4">
</when>
<otherwise>
<!-- decide what you want to do here -->
</otherwise>
</choice>
这篇关于Mule-ESB:基于HTTP状态的Mule筛选器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文