Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MuleSoft configuração do for each

MuleSoft configuração do for each

MuleSoft configuração do for each

Alex teles

August 07, 2016
Tweet

More Decks by Alex teles

Other Decks in Education

Transcript

  1.  <?xml version="1.0" encoding="UTF-8"?>  <mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:schedulers="http://www.mulesoft.org/schema/mule/schedulers" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:json="http://www.mulesoft.org/schema/mule/json"

    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/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd  http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd  http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd  http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd  http://www.mulesoft.org/schema/mule/schedulers http://www.mulesoft.org/schema/mule/schedulers/current/mule-schedulers.xsd">  <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>  <db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="root" database="mulesoft2016" doc:name="MySQL Configuration"/>  <flow name="foreachFlow">  <poll doc:name="Poll">  <schedulers:cron-scheduler expression="0 0 1 1 * ? 2016"/>  <logger level="INFO" doc:name="Logger"/>  </poll>  <logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>  <db:select config-ref="MySQL_Configuration" doc:name="Database">  <db:parameterized-query><![CDATA[select cpf, idade, nome from dados_pessoais]]></db:parameterized-query>  </db:select>  <foreach collection="#[payload]" batchSize="2" doc:name="For Each">  <logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>  </foreach>  <logger message="Fim" level="INFO" doc:name="Logger"/>  </flow>  </mule>