简体   繁体   English

无法退出 wso2 esb 中的迭代

[英]can not exit from iterate in wso2 esb

I am new to wso2 esb and now I have trouble with iterate mediator.我是 wso2 esb 的新手,现在我在迭代调解器方面遇到了麻烦。 I used iterate in my code and send desired value to an endpoint but Unfortunately I can not exit from iterator.我在我的代码中使用了迭代并将所需的值发送到端点,但不幸的是我无法退出迭代器。 here is my code这是我的代码

<iterate preservePayload="true"
              attachPath="//csv-set"
              expression="//csv-set/searchGuestIdentity"
              sequential="true">
        <target>
           <sequence>
              <xslt key="gov:/xmltocsv.xsl"/>
              <xslt key="gov:/new8.xsl"/>
              <xslt key="gov:/RemoveXMLdeclaration.xsl"/>
              <send>
                 <endpoint>
                    <http format="soap11"
                          method="GET"
                          uri-template="http://myendpoint/services/GuestIdentityService"/>
                 </endpoint>
              </send>
              <log level="full"/>
           </sequence>
        </target>
     </iterate>
     <log>
        <property name="log" value="end of iterate"/>
     </log>

I can not see the log after iterate.迭代后我看不到日志。 can any one help me and say why I can not exit from iterator?任何人都可以帮助我说为什么我不能退出迭代器吗? also when I send value to endpoint, how can I see the result?另外,当我向端点发送值时,如何查看结果?

I realize the question was asked a long time ago, but maybe someone might need an answer.我意识到这个问题很久以前就有人问过了,但也许有人可能需要答案。

Try to use parameter "continueParent" set to "true" in Iterate mediator:尝试在迭代介体中使用参数“continueParent”设置为“true”:

<iterate preservePayload="true"
              continueParent="true"
              attachPath="//csv-set"
              expression="//csv-set/searchGuestIdentity"
              sequential="true">

According to wso2 documentation this parameter is used to specify whether the original message should be preserved or not.根据 wso2 文档,此参数用于指定是否应保留原始消息。 Possible values are as follows.可能的值如下。

  • True - If this is selected, the original message will be preserved. True - 如果选择此项,将保留原始消息。
  • False - If this is selected, the original message will be discarded. False - 如果选择此项,原始消息将被丢弃。 This is the default value.这是默认值。

When you use send mediator inside the iterator, response will come to out sequence. 当您在迭代器中使用send mediator时,响应将顺序出现。 There you can use aggregate mediator[1] to aggregate the responses. 在那里,您可以使用聚合介体[1]来聚合响应。 You can find an example here[2]. 您可以在此处找到示例[2]。 Instead of send mediator ,if you use call mediator[3][4] responses will come to in sequence it self and rest of the logic will get executed. 如果不使用发送调解器,则使用调用调解器[3] [4]会依次产生响应,并且自身的逻辑将被执行。

[1] https://docs.wso2.com/display/ESB500/Aggregate+Mediator [1] https://docs.wso2.com/display/ESB500/Aggregate+Mediator

[2] http://shriwithjava.blogspot.com/2015/11/how-to-use-iterator-mediator-in-wso2-esb.html [2] http://shriwithjava.blogspot.com/2015/11/how-to-use-iterator-mediator-in-wso2-esb.html

[3] https://docs.wso2.com/display/ESB500/Call+Mediator [3] https://docs.wso2.com/display/ESB500/Call+Mediator

[4] https://medium.com/@pubududp/wso2-esb-how-to-use-call-mediator-457f2b387b94#.iu53akgyr [4] https://medium.com/@pubududp/wso2-esb-how-to-use-call-mediator-457f2b387b94#.iu53akgyr

Using Call mediator instead of send mediator and set yes for call mediator. 使用“呼叫”中介而不是“发送”中介,并为“呼叫”中介设置“是”。 Then you can use response mediator in end of your sequence to see the value of property in the log mediator 然后,您可以在序列末尾使用响应中介程序,以在日志中介程序中查看属性的值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM