SlideShare uma empresa Scribd logo
1 de 8
For Each Component
15-12-2015
Abstract
• The main motto of this PPT is how to use For
Each component in our applications.
Introduction
• The Foreach scope splits a collection into
elements and processes them iteratively
through the processors embedded in the
scope, then returns the original message to
the flow.
Example
• .mflow<?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" 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" version="EE-3.4.0" 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://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd">
• <jdbc-ee:mssql-data-source name="MS_SQL_Data_Source" user=“****" password=“****"
url="jdbc:sqlserver://localhost;databaseName=test1" transactionIsolation="UNSPECIFIED" doc:name="MS SQL Data Source"/>
• <jdbc-ee:connector name="Database" dataSource-ref="MS_SQL_Data_Source" validateConnections="true" queryTimeout="-1"
pollingFrequency="0" doc:name="Database"/>
• <flow name="Database_ComponentFlow1" doc:name="Database_ComponentFlow1">
• <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8087" path="database" doc:name="HTTP"/>
• <logger message="--main flow--" level="INFO" doc:name="Logger"/>
• <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-
ref="Database" doc:name="Database">
• <jdbc-ee:query key="select" value="select * from mytable"/>
• </jdbc-ee:outbound-endpoint>
• <foreach collection="#[payload]" doc:name="For Each">
• <logger message="--In foreach loop" level="INFO" doc:name="Logger"/>
• <logger message="--Result--#[payload]" level="INFO" doc:name="Logger"/>
• </foreach>
• </flow>
• </mule>
• Output:INFO 2015-10-03 17:50:45,299 [main] org.mule.DefaultMuleContext:
• **********************************************************************
• * Application: Database Component *
• * OS encoding: Cp1252, Mule encoding: UTF-8 *
• * *
• * Agents Running: *
• * Clustering Agent *
• * JMX Agent *
• **********************************************************************
• INFO 2015-10-03 17:50:45,300 [main] org.mule.module.launcher.MuleDeploymentService:
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• + Started app 'Database Component' +
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• INFO 2015-10-03 17:50:52,770 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-main flow--
• INFO 2015-10-03 17:50:52,778 [[Database Component].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager:
Initialising: 'Database.dispatcher.424429501'. Object is: EEJdbcMessageDispatcher
• INFO 2015-10-03 17:50:52,779 [[Database Component].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager:
Starting: 'Database.dispatcher.424429501'. Object is: EEJdbcMessageDispatcher
• INFO 2015-10-03 17:50:53,042 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-In foreach loop
• INFO 2015-10-03 17:50:53,046 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-Result--{subj=Hindi, marks=55, name=Ramesh, id=1}
• INFO 2015-10-03 17:50:53,047 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-In foreach loop
• INFO 2015-10-03 17:50:53,049 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-Result--{subj=English, marks=65, name=Mahesh, id=2}
• INFO 2015-10-03 17:50:53,050 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-In foreach loop
• INFO 2015-10-03 17:50:53,052 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-Result--{subj=science, marks=75, name=Pavan, id=3}
• INFO 2015-10-03 17:50:53,053 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-In foreach loop
• INFO 2015-10-03 17:50:53,056 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: -
-Result--{subj=social, marks=45, name=Siva, id=4}
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8087/foreach
2. Database component connects to the specific
database, executes the select query and prints
the result (one by one) using for each
component
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/foreach

Mais conteúdo relacionado

Mais procurados

Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in muleAnilKumar Etagowni
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connectorRaviRajuRamaKrishna
 
Database Connection Pooling With c3p0
Database Connection Pooling With c3p0Database Connection Pooling With c3p0
Database Connection Pooling With c3p0Kasun Madusanke
 
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
Caching & validating
Caching & validatingCaching & validating
Caching & validatingSon Nguyen
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by CapistranoTasawr Interactive
 
Browser Caching and You: A Love Story
Browser Caching and You: A Love StoryBrowser Caching and You: A Love Story
Browser Caching and You: A Love StoryMark Nottingham
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7bmeme
 
Puppet Dashboard at HEP, Cambridge
Puppet Dashboard at HEP, CambridgePuppet Dashboard at HEP, Cambridge
Puppet Dashboard at HEP, CambridgeSantanu Das
 

Mais procurados (16)

Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in mule
 
Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013
 
Servlets
ServletsServlets
Servlets
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connector
 
Database Connection Pooling With c3p0
Database Connection Pooling With c3p0Database Connection Pooling With c3p0
Database Connection Pooling With c3p0
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#30.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 
Caching & validating
Caching & validatingCaching & validating
Caching & validating
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Browser Caching and You: A Love Story
Browser Caching and You: A Love StoryBrowser Caching and You: A Love Story
Browser Caching and You: A Love Story
 
Mule XML java sample
Mule XML java sampleMule XML java sample
Mule XML java sample
 
Mulexml java
Mulexml javaMulexml java
Mulexml java
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
 
Puppet Dashboard at HEP, Cambridge
Puppet Dashboard at HEP, CambridgePuppet Dashboard at HEP, Cambridge
Puppet Dashboard at HEP, Cambridge
 

Destaque

Stratégie hospitalière de lutte contre les violences faites aux femmes
Stratégie hospitalière de lutte contre les violences faites aux femmesStratégie hospitalière de lutte contre les violences faites aux femmes
Stratégie hospitalière de lutte contre les violences faites aux femmesGynsf
 
SanthoshMP_Resume
SanthoshMP_ResumeSanthoshMP_Resume
SanthoshMP_ResumeSanthosh Mp
 
I viaggi di passione avventura
I viaggi di passione avventuraI viaggi di passione avventura
I viaggi di passione avventuraFabio Bonfante
 
Maria Grazia Maffucci - progettazione per obiettivi
Maria Grazia Maffucci - progettazione per obiettiviMaria Grazia Maffucci - progettazione per obiettivi
Maria Grazia Maffucci - progettazione per obiettiviMaria Grazia Maffucci
 
Reglamento del aprendiz sena
Reglamento del aprendiz senaReglamento del aprendiz sena
Reglamento del aprendiz senaLarry-97
 
Securing Systems of Engagement
Securing Systems of EngagementSecuring Systems of Engagement
Securing Systems of EngagementJohn Palfreyman
 
Maria Grazia Maffucci - programmazione relazione
Maria Grazia Maffucci - programmazione relazioneMaria Grazia Maffucci - programmazione relazione
Maria Grazia Maffucci - programmazione relazioneMaria Grazia Maffucci
 
Maria Grazia Maffucci - relazione reti: progettazione per obiettivi
Maria Grazia Maffucci - relazione reti: progettazione per obiettiviMaria Grazia Maffucci - relazione reti: progettazione per obiettivi
Maria Grazia Maffucci - relazione reti: progettazione per obiettiviMaria Grazia Maffucci
 
Maria Grazia maffucci presentazione relazionefinale
Maria Grazia maffucci   presentazione relazionefinaleMaria Grazia maffucci   presentazione relazionefinale
Maria Grazia maffucci presentazione relazionefinaleMaria Grazia Maffucci
 
Health Total
Health TotalHealth Total
Health TotalAlisiaG
 

Destaque (17)

Stratégie hospitalière de lutte contre les violences faites aux femmes
Stratégie hospitalière de lutte contre les violences faites aux femmesStratégie hospitalière de lutte contre les violences faites aux femmes
Stratégie hospitalière de lutte contre les violences faites aux femmes
 
Museos y rrss etpm 2016
Museos y rrss etpm 2016Museos y rrss etpm 2016
Museos y rrss etpm 2016
 
SanthoshMP_Resume
SanthoshMP_ResumeSanthoshMP_Resume
SanthoshMP_Resume
 
I viaggi di passione avventura
I viaggi di passione avventuraI viaggi di passione avventura
I viaggi di passione avventura
 
Until Successful Component
Until Successful ComponentUntil Successful Component
Until Successful Component
 
Maria Grazia Maffucci - progettazione per obiettivi
Maria Grazia Maffucci - progettazione per obiettiviMaria Grazia Maffucci - progettazione per obiettivi
Maria Grazia Maffucci - progettazione per obiettivi
 
Reglamento del aprendiz sena
Reglamento del aprendiz senaReglamento del aprendiz sena
Reglamento del aprendiz sena
 
Securing Systems of Engagement
Securing Systems of EngagementSecuring Systems of Engagement
Securing Systems of Engagement
 
Maria Grazia Maffucci - programmazione relazione
Maria Grazia Maffucci - programmazione relazioneMaria Grazia Maffucci - programmazione relazione
Maria Grazia Maffucci - programmazione relazione
 
Maria Grazia Maffucci - relazione reti: progettazione per obiettivi
Maria Grazia Maffucci - relazione reti: progettazione per obiettiviMaria Grazia Maffucci - relazione reti: progettazione per obiettivi
Maria Grazia Maffucci - relazione reti: progettazione per obiettivi
 
File component
File componentFile component
File component
 
SITE-rminology
SITE-rminologySITE-rminology
SITE-rminology
 
Maria Grazia maffucci presentazione relazionefinale
Maria Grazia maffucci   presentazione relazionefinaleMaria Grazia maffucci   presentazione relazionefinale
Maria Grazia maffucci presentazione relazionefinale
 
Health Total
Health TotalHealth Total
Health Total
 
Choice component
Choice componentChoice component
Choice component
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Disol
DisolDisol
Disol
 

Semelhante a For Each Component

For each component
For each component For each component
For each component F K
 
For each component in mule
For each component in muleFor each component in mule
For each component in mulejaveed_mhd
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demoSudha Ch
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice componentmaheshtheapex
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice componentDivyaSree1391
 
Choice component
Choice component Choice component
Choice component F K
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponentakshay yeluru
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
Message properties component
Message properties component Message properties component
Message properties component Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties componentF K
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentprinceirfancivil
 

Semelhante a For Each Component (20)

For each component
For each component For each component
For each component
 
For each component
For each component For each component
For each component
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
For each component
For each component For each component
For each component
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice component
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
 
Choice component
Choice component Choice component
Choice component
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
 
Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
How to use message enricher
How to use message enricherHow to use message enricher
How to use message enricher
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
How to use Request Reply scope
How to use Request Reply scopeHow to use Request Reply scope
How to use Request Reply scope
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

For Each Component

  • 2. Abstract • The main motto of this PPT is how to use For Each component in our applications.
  • 3. Introduction • The Foreach scope splits a collection into elements and processes them iteratively through the processors embedded in the scope, then returns the original message to the flow.
  • 5. • .mflow<?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" 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" version="EE-3.4.0" 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://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd"> • <jdbc-ee:mssql-data-source name="MS_SQL_Data_Source" user=“****" password=“****" url="jdbc:sqlserver://localhost;databaseName=test1" transactionIsolation="UNSPECIFIED" doc:name="MS SQL Data Source"/> • <jdbc-ee:connector name="Database" dataSource-ref="MS_SQL_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/> • <flow name="Database_ComponentFlow1" doc:name="Database_ComponentFlow1"> • <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8087" path="database" doc:name="HTTP"/> • <logger message="--main flow--" level="INFO" doc:name="Logger"/> • <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector- ref="Database" doc:name="Database"> • <jdbc-ee:query key="select" value="select * from mytable"/> • </jdbc-ee:outbound-endpoint> • <foreach collection="#[payload]" doc:name="For Each"> • <logger message="--In foreach loop" level="INFO" doc:name="Logger"/> • <logger message="--Result--#[payload]" level="INFO" doc:name="Logger"/> • </foreach> • </flow> • </mule>
  • 6. • Output:INFO 2015-10-03 17:50:45,299 [main] org.mule.DefaultMuleContext: • ********************************************************************** • * Application: Database Component * • * OS encoding: Cp1252, Mule encoding: UTF-8 * • * * • * Agents Running: * • * Clustering Agent * • * JMX Agent * • ********************************************************************** • INFO 2015-10-03 17:50:45,300 [main] org.mule.module.launcher.MuleDeploymentService: • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • + Started app 'Database Component' + • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • INFO 2015-10-03 17:50:52,770 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -main flow-- • INFO 2015-10-03 17:50:52,778 [[Database Component].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.424429501'. Object is: EEJdbcMessageDispatcher • INFO 2015-10-03 17:50:52,779 [[Database Component].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.424429501'. Object is: EEJdbcMessageDispatcher • INFO 2015-10-03 17:50:53,042 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -In foreach loop • INFO 2015-10-03 17:50:53,046 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -Result--{subj=Hindi, marks=55, name=Ramesh, id=1} • INFO 2015-10-03 17:50:53,047 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -In foreach loop • INFO 2015-10-03 17:50:53,049 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -Result--{subj=English, marks=65, name=Mahesh, id=2} • INFO 2015-10-03 17:50:53,050 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -In foreach loop • INFO 2015-10-03 17:50:53,052 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -Result--{subj=science, marks=75, name=Pavan, id=3} • INFO 2015-10-03 17:50:53,053 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -In foreach loop • INFO 2015-10-03 17:50:53,056 [[Database Component].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: - -Result--{subj=social, marks=45, name=Siva, id=4}
  • 7. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8087/foreach 2. Database component connects to the specific database, executes the select query and prints the result (one by one) using for each component