2012-06-09 19 views
1

我有這樣的WSO2 ESB代理:如何使inSequence中沒有發送

<?xml version="1.0" encoding="UTF-8"?> 
<proxy xmlns="http://ws.apache.org/ns/synapse" name="sid008" transports="http" startOnLoad="true" trace="disable"> 
    <target> 
     <inSequence> 

      <switch source="get-property('inquiryId')"> 
         <log level="full"/> 
       <case regex=""> 

         <send/> 

       </case> 
       <default> 

       </default> 
      </switch> 

     </inSequence> 

     <outSequence>      
<....some processing..> 
      <send/> 

     </outSequence> 
    </target> 
    <publishWSDL key="CommonService.wsdl"> 
     <resource location="request.xsd" key="request.xsd"/> 
     <resource location="response.xsd" key="response.xsd"/> 
     <resource location="SMEV.xsd" key="SMEV.xsd"/> 
     <resource location="statusAndError.xsd" key="statusAndError.xsd"/> 
    </publishWSDL> 
</proxy> 

在該代理在默認情況下不發送中介不運行outSequence。我如何能做到這一點,而不發送中介

+0

一般來說,如果inSequence沒有指定發送中介,那麼WSO2 ESB收到的消息將在inSequence結尾處被刪除。由於請求消息沒有真正進入代理配置中提到的端點,因此在outSequence中確實沒有響應。你的用例是什麼? –

回答

2

試試這個配置爲:

<default> 
    <... some processing ...> 
    <header action="remove" name="To"/> 
    <property action="set" name="RESPONSE" scope="default" type="STRING" value="true"/> 
    <send/> 
</default> 

有了這個配置,你會直接從inSequence中的一部分發送響應客戶端(你會不會進入outSequence)。

+0

謝謝!它工作! – Sotona

1

背後In和Out序列的理性是:

序列:當消息涉及到一個代理服務從客戶端,它總是轉到在序列。

出序列:當代理服務發送一個信息從ESB到後端服務,響應會經常來輸出序列(除非指定使用接收序列的順序。)

希望這有助於。

相關問題