2012-06-09 21 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到后端服务,响应会经常来输出序列(除非指定使用接收序列的顺序。)

希望这有助于。

相关问题