SlideShare a Scribd company logo
Mule batch processing
 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.
Mule batch processing
 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

PPTX
Junit in mule demo
PPTX
Python component in mule
PPTX
Bindings of components in mule
PPTX
Component bindings in mule
PPTX
Enjoy Munit with Mule
PPTX
Mule esb file to-string flow
PPTX
Shipping your logs to elk from mule app/cloudhub part 2
PPTX
Quartz connector mule
Junit in mule demo
Python component in mule
Bindings of components in mule
Component bindings in mule
Enjoy Munit with Mule
Mule esb file to-string flow
Shipping your logs to elk from mule app/cloudhub part 2
Quartz connector mule

What's hot (18)

PPTX
Mule ESB - Mock Salesforce Interface
PPTX
Junit in mule demo
PPTX
Mule testing
PPT
Mule - logger
PPTX
Mule dataweave
PPTX
Using message enricher
PPTX
Xslt in mule
PPTX
Mule Esb Data Weave
PPTX
Mule enricher
PPTX
Using spring task scheduler in java in mule
PPTX
Mule debugging
PPTX
Mule system properties
PPTX
Splitting with mule part2
PPT
Mule introduction
PPTX
Mule esb How to convert from CSV to Json in 5 minutes
PPTX
Filter expression in mule
PPTX
Mule Ajax Connector
PPTX
For each component in mule
Mule ESB - Mock Salesforce Interface
Junit in mule demo
Mule testing
Mule - logger
Mule dataweave
Using message enricher
Xslt in mule
Mule Esb Data Weave
Mule enricher
Using spring task scheduler in java in mule
Mule debugging
Mule system properties
Splitting with mule part2
Mule introduction
Mule esb How to convert from CSV to Json in 5 minutes
Filter expression in mule
Mule Ajax Connector
For each component in mule
Ad

Viewers also liked (17)

PPTX
Mule batch job
PPTX
Mule properties
PPTX
Dataweave 160103180124
PPTX
Mule using Salesforce
PPTX
Automatic documentation with mule
 
PPTX
Mule esb How to convert from Object to Json in 5 minutes
PPT
Simple Poll in Mule
ODP
Cloudhub deployment
ODP
Cloudhub – architecture
PPTX
Spring Boot Update
PPTX
Mule ESB Training
PPTX
Mule ESB Tutorial Part 2
PPTX
Mule - error handling
PPT
Mulesoft ppt
PPTX
Mule ESB Tutorial Part 1
PDF
Mule ESB Fundamentals
PDF
Mule ESB - Integration Simplified
Mule batch job
Mule properties
Dataweave 160103180124
Mule using Salesforce
Automatic documentation with mule
 
Mule esb How to convert from Object to Json in 5 minutes
Simple Poll in Mule
Cloudhub deployment
Cloudhub – architecture
Spring Boot Update
Mule ESB Training
Mule ESB Tutorial Part 2
Mule - error handling
Mulesoft ppt
Mule ESB Tutorial Part 1
Mule ESB Fundamentals
Mule ESB - Integration Simplified
Ad

Similar to Mule batch processing (20)

PPTX
Mulebatch
PPTX
Mule batch
PPTX
M batching
PPTX
Mule batch
PPTX
Mule batch introduction
PPT
Batch processing
PPT
Batch processing
PPT
Batch processing
PPTX
Introduction to transaction processing concepts and theory
PDF
What is COTI?
PPTX
Build process ppt.pptx
PDF
Synchronization
PDF
How to Integrate Internet of Things with Webserver with
PDF
PDF
Monit a2
PDF
Toby
PDF
PDF
Toby6
PDF
Tinoub1
Mulebatch
Mule batch
M batching
Mule batch
Mule batch introduction
Batch processing
Batch processing
Batch processing
Introduction to transaction processing concepts and theory
What is COTI?
Build process ppt.pptx
Synchronization
How to Integrate Internet of Things with Webserver with
Monit a2
Toby
Toby6
Tinoub1

More from Ravinder Singh (9)

PPTX
Mule in a nutshell
PPTX
Mule java part-4
PPTX
Mule java part-3
PPTX
Mule java part-2
PPTX
Mule java part-1
PPTX
Mule enricher
PPTX
Mule splitters
PPTX
Mule expression
PPT
Jms topics
Mule in a nutshell
Mule java part-4
Mule java part-3
Mule java part-2
Mule java part-1
Mule enricher
Mule splitters
Mule expression
Jms topics

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
PDF
Basic Mud Logging Guide for educational purpose
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Lesson notes of climatology university.
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning
Basic Mud Logging Guide for educational purpose
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
01-Introduction-to-Information-Management.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial diseases, their pathogenesis and prophylaxis
O5-L3 Freight Transport Ops (International) V1.pdf
Cell Structure & Organelles in detailed.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Lesson notes of climatology university.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Anesthesia in Laparoscopic Surgery in India
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Types and Its function , kingdom of life
Pharmacology of Heart Failure /Pharmacotherapy of CHF

Mule batch processing

  • 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.
  • 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.