在ESB WSO2中使用clone mediator时无法按顺序返回

时间:2016-02-25 06:01:50

标签: wso2 wso2esb

我从DZONE博客中为克隆调解员提供了一个示例,但看起来我犯了一些错误,无法返回结果进一步处理。

有人可以提供帮助吗?

  <proxy name="DSS_TrainDetailsProxy" transports="http" startOnLoad="true" trace="disable" statistics="enable">
    <target inSequence="DSS_TrainDetails_IN" outSequence="DSS_TrainDetails_OUT" faultSequence="CommonFaultHandler"/>
    <publishWSDL key="DSS_TrainDetails_wsdl"/>
</proxy>
 <localEntry key="DSS_TrainDetails_wsdl" src="file:repository/conf/train/wsdl/TrainDetails.wsdl"/>

<sequence name="DSS_TrainDetails_IN">
 <clone>
     <target>
        <send>
            <endpoint key="DSS_TrainDetails_EPR"/>
        </send>
    </target>
    <target>
        <send>
            <endpoint key="DSS_TrainDetails_EPR"/>
        </send>
    </target>
    <target>
        <send>
            <endpoint key="DSS_TrainDetails_EPR"/>
        </send>
    </target>
</clone>

    <sequence name="DSS_TrainDetails_OUT">

   <aggregate>
        <completeCondition>
            <messageCount min="-1" max="-1"/>
        </completeCondition>
        <onComplete xmlns:tra="traindetails.co.nz" expression="//tra:TrainDetails">
            <log level="custom" separator=",">
                <property name="MessageFlow" value="======================= Sending Back the Aggregated Responses. ==============="/>
            </log>
            <log level="full" separator=","/>
            <enrich>
                <source xmlns:tra="traindetails.co.nz" clone="true" xpath="//tra:TrainDetails/tra:TrainsDetails"/>
                <target type="body" action="child"/>
            </enrich>
            <send/>
        </onComplete>
    </aggregate>

</sequence>

2 个答案:

答案 0 :(得分:1)

您只是想让您知道克隆调解员为我工作:)我已通过以下代码对IN序列进行了更改我已从IN序列中删除了“发送”关键字:

<sequence name="DSS_TrainDetails_IN">
 <clone>
     <target>
            <endpoint key="DSS_TrainDetails_EPR"/>
    </target>
    <target>
            <endpoint key="DSS_TrainDetails_EPR1"/>
    </target>
    <target>
            <endpoint key="DSS_TrainDetails_EPR2"/>
    </target>
</clone>

答案 1 :(得分:0)

尝试:在您的代理def和克隆目标中移除outSequence =“DSS_TrainDetails_OUT”,将<send>更改为<send receive="DSS_TrainDetails_OUT">