Mule esb:使用Choice Router根据状态代码处理Jersey响应?
如何根据Mule esb:使用Choice Router根据状态代码处理Jersey响应?,mule,Mule,如何根据201或503处理Rest服务响应?我可以混合使用groovy和其他计算器吗?在我的示例中,该部分使用消息属性和其他groovy <flow> <http:outbound-endpoint address="${host}" exchange-pattern="request-response"/> <when expression="message:INBOUND:http.status==201"> <flow
201
或503
处理Rest
服务响应?我可以混合使用groovy
和其他计算器吗?在我的示例中,该部分使用消息属性和其他groovy
<flow>
<http:outbound-endpoint address="${host}" exchange-pattern="request-response"/>
<when expression="message:INBOUND:http.status==201">
<flow-ref name=="flow2">
<when expression="message:INBOUND:http.status==503">
<flow-ref name="flow3">
<when expression="payload instanceof java.lang.SocketException" evaluator="groovy">
<flow-ref name="flow4">
</flow>
您可以使用语法完成所有这些操作
选择
需要一个块,否则
块也需要决定在这种情况下要做什么
<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="#[exception instanceof java.net.SocketException]">
<flow-ref name="flow4">
</when>
<otherwise>
<!-- decide what you want to do here -->
</otherwise>
</choice>
</flow>