SlideShare a Scribd company logo
1 of 10
EXPRESSION ROUTING IN MULE
V A S A N T H I I
ROUTING
The Routing module reviews the different types of Routers and how
Routers are used to control how messages are sent and received
by components. The message can be route in different ways.
Below are explained in this example.
• Splitters and Aggregators
• Collection splitter and Collection Aggregator
• Message chunk splitter and Message chunk
aggregator
• Scatter gather
• For each
• Mule flows, Sub flows and flow reference
For Each:
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.
As For Each expects a collection object is expected a java
component is used to generate a List object.
Above properties are available in for each scope. Collection field
which accepts MEL to provide a collection object to the for each
component for iteration. Counter Variable Name is a variable
which stores the count of iterations. Batch Size is partition the
Collection into sub collections of the specified size. Root Message
Variable Name holds the message before being split.
Main Flow, Sub Flow and Flow reference:
A mule flow (main flow) which accepts message source and
message processor where sub flow accepts only message
processor. Sub flow can be called via flow reference because it
doesn't accept messag source.
Sub flow runs completely in the same context of the flow that calls
it, inheriting transcation context, exception handler, all variables
and headers, etc.
A Main flow has its own context, transcation context, exception
handler, all variables and headers etc.
Filters:
Filters are used to filter the message using mule expressions.
Above flow accepts a HTTP request and filters the message using
Expression filter and also throws an exception if Expression
filter is not satisfied using Message Filter.
Expression Filter allows you to right a Mule Expression. if the expression
returns true then the process continuous to next message processor. or
else the flow get discarded without throwing any exception. Here the
condition is checking for payload instance is java.util.List or not.
If we need to throw an exception when Expression Filter returns
false, then Expression filter needs wrapped up the Message
Filter and throwOnUnaccecpted attribute should be true as
shown in below snippet.
Thank You All

More Related Content

What's hot

What's hot (20)

Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 
Message structure
Message structureMessage structure
Message structure
 
Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
 
Scatter gatherinmule
Scatter gatherinmuleScatter gatherinmule
Scatter gatherinmule
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
Choice router mule
Choice router   muleChoice router   mule
Choice router mule
 
Mule esb mule message
Mule esb   mule messageMule esb   mule message
Mule esb mule message
 
Mule Custom Aggregator
Mule Custom AggregatorMule Custom Aggregator
Mule Custom Aggregator
 
Muleflowarchitecturepart2
Muleflowarchitecturepart2Muleflowarchitecturepart2
Muleflowarchitecturepart2
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with mule
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scope
 
Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in mule
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
 
mule custom aggregator
mule   custom aggregatormule   custom aggregator
mule custom aggregator
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 

Viewers also liked

Viewers also liked (20)

Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Mule saas
Mule  saasMule  saas
Mule saas
 
Mulesoft Soap Service
Mulesoft Soap ServiceMulesoft Soap Service
Mulesoft Soap Service
 
Java in mule part 2
Java in mule part 2Java in mule part 2
Java in mule part 2
 
Java in mule part 3
Java in mule part 3Java in mule part 3
Java in mule part 3
 
Git hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studioGit hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studio
 
Enabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX AccessEnabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX Access
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
 
Anypoint Platform Deployment Strategies
Anypoint Platform Deployment StrategiesAnypoint Platform Deployment Strategies
Anypoint Platform Deployment Strategies
 
Mule
MuleMule
Mule
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartz
 
Drools in Mule
Drools in MuleDrools in Mule
Drools in Mule
 
Mule soft esb – data validation best practices
Mule soft esb – data validation best practicesMule soft esb – data validation best practices
Mule soft esb – data validation best practices
 
Vm component in mule demo
Vm component in mule demoVm component in mule demo
Vm component in mule demo
 
Telling the world why we love mule soft!
Telling the world why we love mule soft!Telling the world why we love mule soft!
Telling the world why we love mule soft!
 
Fetch records from mysql using mule esb
Fetch records from mysql using mule esbFetch records from mysql using mule esb
Fetch records from mysql using mule esb
 
Until successful component in mule demo
Until successful component in mule demoUntil successful component in mule demo
Until successful component in mule demo
 
Mule Esb
Mule EsbMule Esb
Mule Esb
 

Similar to Routing in mule

High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
James Carr
 

Similar to Routing in mule (20)

M filtering
M filteringM filtering
M filtering
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
 
Routing and filters
Routing and filtersRouting and filters
Routing and filters
 
Types of MessageRouting in Mule
Types of MessageRouting in MuleTypes of MessageRouting in Mule
Types of MessageRouting in Mule
 
M split
M splitM split
M split
 
Wcf routing kt
Wcf routing ktWcf routing kt
Wcf routing kt
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control reference
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questions
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Controlling message flow
Controlling message flowControlling message flow
Controlling message flow
 
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
 
Mule any point studio
Mule any point studioMule any point studio
Mule any point studio
 
Elements in a mule flow
Elements in a mule flowElements in a mule flow
Elements in a mule flow
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestration
 
Service orchestration by using flows
Service orchestration by using flowsService orchestration by using flows
Service orchestration by using flows
 
Service orchestration by using flows
Service orchestration by using flowsService orchestration by using flows
Service orchestration by using flows
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 

Recently uploaded

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Routing in mule

  • 1. EXPRESSION ROUTING IN MULE V A S A N T H I I
  • 2. ROUTING The Routing module reviews the different types of Routers and how Routers are used to control how messages are sent and received by components. The message can be route in different ways. Below are explained in this example. • Splitters and Aggregators • Collection splitter and Collection Aggregator • Message chunk splitter and Message chunk aggregator • Scatter gather • For each • Mule flows, Sub flows and flow reference
  • 3. For Each: 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.
  • 4. As For Each expects a collection object is expected a java component is used to generate a List object. Above properties are available in for each scope. Collection field which accepts MEL to provide a collection object to the for each component for iteration. Counter Variable Name is a variable which stores the count of iterations. Batch Size is partition the Collection into sub collections of the specified size. Root Message Variable Name holds the message before being split.
  • 5. Main Flow, Sub Flow and Flow reference: A mule flow (main flow) which accepts message source and message processor where sub flow accepts only message processor. Sub flow can be called via flow reference because it doesn't accept messag source. Sub flow runs completely in the same context of the flow that calls it, inheriting transcation context, exception handler, all variables and headers, etc. A Main flow has its own context, transcation context, exception handler, all variables and headers etc.
  • 6.
  • 7. Filters: Filters are used to filter the message using mule expressions. Above flow accepts a HTTP request and filters the message using Expression filter and also throws an exception if Expression filter is not satisfied using Message Filter.
  • 8. Expression Filter allows you to right a Mule Expression. if the expression returns true then the process continuous to next message processor. or else the flow get discarded without throwing any exception. Here the condition is checking for payload instance is java.util.List or not.
  • 9. If we need to throw an exception when Expression Filter returns false, then Expression filter needs wrapped up the Message Filter and throwOnUnaccecpted attribute should be true as shown in below snippet.