0

またはJersey Restに基づいてサービス応答を処理するにはどうすればよいですか? と他の評価者を混在させることはできますか? 私の例では、一部はメッセージ プロパティとその他の groovy を使用しています。201503groovy

<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>  
4

1 に答える 1

1

これらはすべてMEL構文を使用して行うことができます。

choiceブロックも必要otherwiseです。その場合に何をしたいかを決めます。

<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> 
于 2013-11-05T13:43:48.523 に答える