【问题标题】:How to make inSequence without send如何在不发送的情况下制作 inSequence
【发布时间】:2012-06-13 01:39:19
【问题描述】:

我有这个 WSO2 ESB 代理:

<?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。不发送调解员怎么办

【问题讨论】:

  • 一般来说,如果 inSequence 没有指定发送中介,那么 WSO2 ESB 收到的消息会在 inSequence 结束时被丢弃。由于请求消息并没有真正进入代理配置中提到的端点,所以 outSequence 中的进程确实没有响应。你的用例是什么?

标签: esb wso2 mediator wso2esb


【解决方案1】:

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

In seq :当消息从客户端到达代理服务时,它总是按顺序发送。

Out Seq:当代理服务将消息从 ESB 发送到后端服务时,响应总是会到达 Out seq(除非使用接收 seq 指定序列。)

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    试试这个配置:

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

    使用此配置,您将直接从 inSequence 部分向客户端发送响应(您不会进入 outSequence)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多