SlideShare a Scribd company logo
1 of 9
Understanding Routing in Mule
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
• Filters
Splitters
Splitters are used to split the message and process split messages in parallel.
After processing completed, those messages get aggregate by aggregator
components. Below is the splitters main flow diagram.
Above flow exposes a HTTP service to implement collection splitter and message
chunk splitter. This flow expects a query parameter ‘splitter’. If ‘splitter’ parameter
value is ‘collection’ then choice router routes the flow to collection splitter or if
the value is ‘chunk’ then it routes to message chunk splitter implementation.
Collection splitter and Collection Aggregator
Collection splitter is used to split collection object and process split messages individually.
Collection splitter expects a collection object as a payload. A java component has been used
to create a List object. Each object of List is routed to another flow via VM queue in one-way
mode.
In the below flow after logger component (which logs payload) we have two important
message processors. Resequencer and Collection Aggregator. While elements of List are
processing invidually, the elements may get change their order. Resequencer is used to
reorder the elements of List object. Collection Aggregator is used to aggregate the processed
invidual message payload.
Message chunk splitter and Message chunk Aggregator
We need to provide some message payload to split the message.
Message chunk splitter is used to chunk a message into a number of fixed-length messages
based on the Message Size you configure in the Message Chunk Spliter.
This splitter first convert the message into byte array then split this array into chunks. Each
chunked message is routed to another flow via VM queue in one-way mode.
Message Chunk Aggregator is used to aggregate the chunked messages. Byte Array to
String component needs to co
Scatter Gather
Scatter Gather is used to send a message to multiple endpoints concurrently. It collects
the response of all the routes and aggregate into a single message.
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
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 message source.
Sub flow runs completely in the same context of the flow that calls it, inheriting
transaction context, exception handler, all variables and headers, etc.
A Main flow has its own context, transaction 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. Refer slide 9
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.
<message-filter throwOnUnaccepted="true" doc:name="Message-filter-thow-exception">
<expression-filter expression="#[payload instanceof
com.techm.splitters.SplitterCollections]"/>
</message-filter>
Routing in mule

More Related Content

What's hot

Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notificationsShanky Gupta
 
Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connectorkumar gaurav
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in muleSon Nguyen
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbRaviShankar Mishra
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing muleRamakrishna kapa
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Data weave reference documentation
Data weave reference documentationData weave reference documentation
Data weave reference documentationD.Rajesh Kumar
 
Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filtersGandham38
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in muleSindhu VL
 
File component in mule
File component in muleFile component in mule
File component in muleRajkattamuri
 
Mule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce InterfaceMule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce Interfacekrishananth
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in muleSindhu VL
 

What's hot (20)

Overview of Mule
Overview of MuleOverview of Mule
Overview of Mule
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connector
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule esb2
Mule esb2Mule esb2
Mule esb2
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Data weave reference documentation
Data weave reference documentationData weave reference documentation
Data weave reference documentation
 
Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Mule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce InterfaceMule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce Interface
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in mule
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 

Viewers also liked

ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using MuleKhasim Cise
 
Usando seu codigo java no mule part 1
Usando seu codigo java no mule part 1Usando seu codigo java no mule part 1
Usando seu codigo java no mule part 1Jeison Barros
 
C3D Labs. Customers & Partners
C3D Labs. Customers & PartnersC3D Labs. Customers & Partners
C3D Labs. Customers & PartnersArkadiy Kamnev
 
Estudo de caso: Mule como um transporte JMS Comum
Estudo de caso: Mule como um transporte JMS ComumEstudo de caso: Mule como um transporte JMS Comum
Estudo de caso: Mule como um transporte JMS ComumJeison Barros
 
Restful considerada prejudicial parte 2
Restful considerada prejudicial   parte 2Restful considerada prejudicial   parte 2
Restful considerada prejudicial parte 2Jeison Barros
 
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...YSF-2015
 
Science Slam: Let's Make Science Interesting
Science Slam: Let's Make Science InterestingScience Slam: Let's Make Science Interesting
Science Slam: Let's Make Science InterestingYSF-2015
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutionsvishnukanthro45
 
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με Πρόπτωση Μήτρας 4ου Βαθμού
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με  Πρόπτωση Μήτρας 4ου ΒαθμούΚυστεοκήλη 3ου Βαθμού σε Συνδιασμό με  Πρόπτωση Μήτρας 4ου Βαθμού
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με Πρόπτωση Μήτρας 4ου ΒαθμούRadiology Archives
 
Hipertensión pulmonar
Hipertensión pulmonarHipertensión pulmonar
Hipertensión pulmonarAngela Meza
 
Projectes d'indagació.
Projectes d'indagació.Projectes d'indagació.
Projectes d'indagació.jdomen44
 
Risk management during start up and commissioning of super critical once thro...
Risk management during start up and commissioning of super critical once thro...Risk management during start up and commissioning of super critical once thro...
Risk management during start up and commissioning of super critical once thro...HIMADRI BANERJI
 
Aprendre química a partir de contextos pseudocientífics.
Aprendre química a partir de contextos pseudocientífics.Aprendre química a partir de contextos pseudocientífics.
Aprendre química a partir de contextos pseudocientífics.cienciaicontroversia
 

Viewers also liked (18)

ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using Mule
 
Usando seu codigo java no mule part 1
Usando seu codigo java no mule part 1Usando seu codigo java no mule part 1
Usando seu codigo java no mule part 1
 
C3D Labs. Customers & Partners
C3D Labs. Customers & PartnersC3D Labs. Customers & Partners
C3D Labs. Customers & Partners
 
Business english
Business englishBusiness english
Business english
 
Estudo de caso: Mule como um transporte JMS Comum
Estudo de caso: Mule como um transporte JMS ComumEstudo de caso: Mule como um transporte JMS Comum
Estudo de caso: Mule como um transporte JMS Comum
 
Partes del ordenador
Partes del ordenadorPartes del ordenador
Partes del ordenador
 
Restful considerada prejudicial parte 2
Restful considerada prejudicial   parte 2Restful considerada prejudicial   parte 2
Restful considerada prejudicial parte 2
 
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...
Part I: Massive Open Online Courses as Revolutionary Chance for Ukraine. Part...
 
Science Slam: Let's Make Science Interesting
Science Slam: Let's Make Science InterestingScience Slam: Let's Make Science Interesting
Science Slam: Let's Make Science Interesting
 
Nurdianto Wu Technical Consultant
Nurdianto Wu Technical ConsultantNurdianto Wu Technical Consultant
Nurdianto Wu Technical Consultant
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutions
 
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με Πρόπτωση Μήτρας 4ου Βαθμού
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με  Πρόπτωση Μήτρας 4ου ΒαθμούΚυστεοκήλη 3ου Βαθμού σε Συνδιασμό με  Πρόπτωση Μήτρας 4ου Βαθμού
Κυστεοκήλη 3ου Βαθμού σε Συνδιασμό με Πρόπτωση Μήτρας 4ου Βαθμού
 
Hipertensión pulmonar
Hipertensión pulmonarHipertensión pulmonar
Hipertensión pulmonar
 
Projectes d'indagació.
Projectes d'indagació.Projectes d'indagació.
Projectes d'indagació.
 
Risk management during start up and commissioning of super critical once thro...
Risk management during start up and commissioning of super critical once thro...Risk management during start up and commissioning of super critical once thro...
Risk management during start up and commissioning of super critical once thro...
 
Aprendre química a partir de contextos pseudocientífics.
Aprendre química a partir de contextos pseudocientífics.Aprendre química a partir de contextos pseudocientífics.
Aprendre química a partir de contextos pseudocientífics.
 
Aυτόχθονες λαοί
Aυτόχθονες λαοίAυτόχθονες λαοί
Aυτόχθονες λαοί
 
αγγλια
αγγλιααγγλια
αγγλια
 

Similar to Routing in mule

Splitters in mule
Splitters in muleSplitters in mule
Splitters in mulevasanthii9
 
Routing in mule
Routing in muleRouting in mule
Routing in mulevasanthii9
 
Mule splitters
Mule splittersMule splitters
Mule splittersGandham38
 
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routerssathyaraj Anand
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control referenceKrishna_in
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBMani Rathnam Gudi
 
Message Chunk Splitter And Aggregator With MuleSoft
Message Chunk Splitter And Aggregator With MuleSoftMessage Chunk Splitter And Aggregator With MuleSoft
Message Chunk Splitter And Aggregator With MuleSoftJitendra Bafna
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_componentsPaaras Baru
 
Iterative processing using the for each scope in
Iterative processing using the for each scope inIterative processing using the for each scope in
Iterative processing using the for each scope inAnkit Lawaniya
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflowThang Loi
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestrationSindhu VL
 
Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Srikanth N
 

Similar to Routing in mule (20)

Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Routing and filters
Routing and filtersRouting and filters
Routing and filters
 
M split
M splitM split
M split
 
M filtering
M filteringM filtering
M filtering
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control reference
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Controlling message flow
Controlling message flowControlling message flow
Controlling message flow
 
Wcf routing kt
Wcf routing ktWcf routing kt
Wcf routing kt
 
Message Chunk Splitter And Aggregator With MuleSoft
Message Chunk Splitter And Aggregator With MuleSoftMessage Chunk Splitter And Aggregator With MuleSoft
Message Chunk Splitter And Aggregator With MuleSoft
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 
Iterative processing using the for each scope in
Iterative processing using the for each scope inIterative processing using the for each scope in
Iterative processing using the for each scope in
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestration
 
Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 

Routing in mule

  • 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 • Filters Splitters Splitters are used to split the message and process split messages in parallel. After processing completed, those messages get aggregate by aggregator components. Below is the splitters main flow diagram.
  • 3. Above flow exposes a HTTP service to implement collection splitter and message chunk splitter. This flow expects a query parameter ‘splitter’. If ‘splitter’ parameter value is ‘collection’ then choice router routes the flow to collection splitter or if the value is ‘chunk’ then it routes to message chunk splitter implementation.
  • 4. Collection splitter and Collection Aggregator Collection splitter is used to split collection object and process split messages individually. Collection splitter expects a collection object as a payload. A java component has been used to create a List object. Each object of List is routed to another flow via VM queue in one-way mode. In the below flow after logger component (which logs payload) we have two important message processors. Resequencer and Collection Aggregator. While elements of List are processing invidually, the elements may get change their order. Resequencer is used to reorder the elements of List object. Collection Aggregator is used to aggregate the processed invidual message payload. Message chunk splitter and Message chunk Aggregator We need to provide some message payload to split the message. Message chunk splitter is used to chunk a message into a number of fixed-length messages based on the Message Size you configure in the Message Chunk Spliter.
  • 5. This splitter first convert the message into byte array then split this array into chunks. Each chunked message is routed to another flow via VM queue in one-way mode. Message Chunk Aggregator is used to aggregate the chunked messages. Byte Array to String component needs to co Scatter Gather Scatter Gather is used to send a message to multiple endpoints concurrently. It collects the response of all the routes and aggregate into a single message.
  • 6.
  • 7. 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 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 message source. Sub flow runs completely in the same context of the flow that calls it, inheriting transaction context, exception handler, all variables and headers, etc. A Main flow has its own context, transaction context, exception handler, all variables and headers etc.
  • 8. 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. Refer slide 9 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. <message-filter throwOnUnaccepted="true" doc:name="Message-filter-thow-exception"> <expression-filter expression="#[payload instanceof com.techm.splitters.SplitterCollections]"/> </message-filter>