SlideShare a Scribd company logo
1 of 10
 Batch component is used to process huge messages in batches. In
batch we have 3 phases.
1. Input
2. Process Records
3. On complete
Input:
Input phase is used to prepare a collection object with input
message. Because process records phase expects a collection object.
Process Records:
 Process Record phase expects a collection object to process the
each record of collection in individually and parallel. Here each object
of collection is a record.
On Complete:
 On complete phase is used to summarize the flow. Following
variables are available in On Complete phase to get the status of flow.
• Count of Successful records
• Count of Failure records
• Count of total records.
Example:
 In the following example, it explains how to transform CSV to XML using
batch. This example exposes a HTTP rest service.
 In the main flow input csv file path sets to payload and refer to a batch
job.
 In Input phase, an expression component is used to read file
(src/main/resources/input.csv) data. This expression component refers
to a file (src/main/resources/ReadFile.txt) which has code to read file
data. Another expression component has below expression to create a
collection object.
 payload = new com.techm.common.util.LineIterator(payload);
 LineIterator is our custom class which implements Iterator Interface to
implement collection object. Below is code of LineIterator class.
Note : Java Code Continuation from line 31 on next slide.
 In Process Records phase, we have two batch steps to transform
payload from csv to xml using datamapper and write the xml data into
a file. Second batch step contains batch commit. The message
processors which are in batch commit scope get execute depends of
size of batch commit.
 <batch:commit size="5" doc:name="Batch Commit">
 This batch commit get executed for every 5 records as configured.
 On Complete phase has one logger component which logs
successful, failure and total no of records.
 Note : SOAP UI project to test this application is placed in
src/test/resources.
Thank You All

More Related Content

What's hot

What's hot (18)

Mule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce InterfaceMule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce Interface
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Mule testing
Mule   testingMule   testing
Mule testing
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
 
Mule dataweave
Mule dataweaveMule dataweave
Mule dataweave
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in mule
 
Mule debugging
Mule   debuggingMule   debugging
Mule debugging
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Mule introduction
Mule introductionMule introduction
Mule introduction
 
Mule esb How to convert from CSV to Json in 5 minutes
Mule esb How to convert from CSV to Json in 5 minutesMule esb How to convert from CSV to Json in 5 minutes
Mule esb How to convert from CSV to Json in 5 minutes
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Mule Ajax Connector
Mule Ajax ConnectorMule Ajax Connector
Mule Ajax Connector
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 

Viewers also liked

Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2
Srikanth N
 

Viewers also liked (17)

Mule batch job
Mule batch jobMule batch job
Mule batch job
 
Mule properties
Mule propertiesMule properties
Mule properties
 
Dataweave 160103180124
Dataweave 160103180124Dataweave 160103180124
Dataweave 160103180124
 
Mule using Salesforce
Mule using SalesforceMule using Salesforce
Mule using Salesforce
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Mule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesMule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutes
 
Simple Poll in Mule
Simple Poll in MuleSimple Poll in Mule
Simple Poll in Mule
 
Cloudhub deployment
Cloudhub deploymentCloudhub deployment
Cloudhub deployment
 
Cloudhub – architecture
Cloudhub – architectureCloudhub – architecture
Cloudhub – architecture
 
Spring Boot Update
Spring Boot UpdateSpring Boot Update
Spring Boot Update
 
Mule ESB Training
Mule ESB TrainingMule ESB Training
Mule ESB Training
 
Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2
 
Mule - error handling
Mule - error handling Mule - error handling
Mule - error handling
 
Mulesoft ppt
Mulesoft pptMulesoft ppt
Mulesoft ppt
 
Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
 

Similar to Mule batch processing

Similar to Mule batch processing (20)

Mulebatch
MulebatchMulebatch
Mulebatch
 
Mule batch
Mule batchMule batch
Mule batch
 
M batching
M batchingM batching
M batching
 
Mule batch
Mule batchMule batch
Mule batch
 
Mule batch introduction
Mule batch introductionMule batch introduction
Mule batch introduction
 
Batch processing
Batch processingBatch processing
Batch processing
 
Batch processing
Batch processingBatch processing
Batch processing
 
Batch processing
Batch processingBatch processing
Batch processing
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
What is COTI?
What is COTI? What is COTI?
What is COTI?
 
Build process ppt.pptx
Build process ppt.pptxBuild process ppt.pptx
Build process ppt.pptx
 
Synchronization
SynchronizationSynchronization
Synchronization
 
My ppt hpc u4
My ppt hpc u4My ppt hpc u4
My ppt hpc u4
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
Monit
MonitMonit
Monit
 
Toby3
Toby3Toby3
Toby3
 
xxxx
xxxxxxxx
xxxx
 
yyyyxxxdd
yyyyxxxddyyyyxxxdd
yyyyxxxdd
 
new title
new titlenew title
new title
 
yyyyxxx
yyyyxxxyyyyxxx
yyyyxxx
 

More from Ravinder Singh (9)

Mule in a nutshell
Mule in a nutshellMule in a nutshell
Mule in a nutshell
 
Mule java part-4
Mule java part-4Mule java part-4
Mule java part-4
 
Mule java part-3
Mule java part-3Mule java part-3
Mule java part-3
 
Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Mule expression
Mule expressionMule expression
Mule expression
 
Jms topics
Jms topicsJms topics
Jms topics
 

Recently uploaded

Recently uploaded (20)

Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Mule batch processing

  • 1.
  • 2.  Batch component is used to process huge messages in batches. In batch we have 3 phases. 1. Input 2. Process Records 3. On complete Input: Input phase is used to prepare a collection object with input message. Because process records phase expects a collection object.
  • 3. Process Records:  Process Record phase expects a collection object to process the each record of collection in individually and parallel. Here each object of collection is a record. On Complete:  On complete phase is used to summarize the flow. Following variables are available in On Complete phase to get the status of flow. • Count of Successful records • Count of Failure records • Count of total records.
  • 4. Example:  In the following example, it explains how to transform CSV to XML using batch. This example exposes a HTTP rest service.
  • 5.  In the main flow input csv file path sets to payload and refer to a batch job.
  • 6.  In Input phase, an expression component is used to read file (src/main/resources/input.csv) data. This expression component refers to a file (src/main/resources/ReadFile.txt) which has code to read file data. Another expression component has below expression to create a collection object.  payload = new com.techm.common.util.LineIterator(payload);  LineIterator is our custom class which implements Iterator Interface to implement collection object. Below is code of LineIterator class.
  • 7. Note : Java Code Continuation from line 31 on next slide.
  • 8.
  • 9.  In Process Records phase, we have two batch steps to transform payload from csv to xml using datamapper and write the xml data into a file. Second batch step contains batch commit. The message processors which are in batch commit scope get execute depends of size of batch commit.  <batch:commit size="5" doc:name="Batch Commit">  This batch commit get executed for every 5 records as configured.  On Complete phase has one logger component which logs successful, failure and total no of records.  Note : SOAP UI project to test this application is placed in src/test/resources.