简体   繁体   中英

Get counter from iterator mediator WSO2 ESB

有没有办法以某种计数器的值来计算WSO2 ESB迭代器调解器迭代了多少时间?

There is as many iteration as xml fragments given by the xpath expression you've defined inside iterate mediator and you can use xpath function "count" to find this value, exemple :

message :

<root>
  <value>
    ...
  </value>
  <value>
    ...
  </value>
</root>

Mediation :

<iterate expression="//value">
   <target>
     ...
   </target>
</iterate>

XPATH giving the number of iteration : count(//value)

Internally, a property "messageSequence" or "messageSequence.ID" (where ID is the value of the iterate mediator's optional id attribute) is initialized with such a counter (it give you something like 0/2 and 1/2 with my sample) but I'm not sure you should use that...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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