MULE foreach循环打印

counter variable name 类似for 循环中的i ,每次迭代都会自增加1



<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
     <http:listener-config name="HTTP_Listener_Configuration22" host="localhost" port="9988" 
     	basePath="ServiceBus" doc:name="HTTP Listener Configuration"/>
    <flow name="foreachFlow">
        <http:listener config-ref="HTTP_Listener_Configuration22" path="/test" doc:name="HTTP"/>
        <custom-transformer class="cn.bmsoft.transform.ReturnListMapTransform"   doc:name="listMap"/>
		<foreach collection="#[payload]" doc:name="Foreach">
				 <logger doc:name="log message" level="INFO" message="********test1: #[payload]"/>
		</foreach>
    </flow>
</mule>

设置

   <set-variable variableName="size" value="#[message.payload.size()]" doc:name="size"/>


猜你喜欢

转载自blog.csdn.net/ke_weiquan/article/details/51828914