SlideShare una empresa de Scribd logo
1 de 9
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>
Types of MessageRouting in Mule

Más contenido relacionado

La actualidad más candente

JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
vikram singh
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
JSP Processing
JSP ProcessingJSP Processing
JSP Processing
Sadhana28
 

La actualidad más candente (20)

Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
Implementing jsp tag extensions
Implementing jsp tag extensionsImplementing jsp tag extensions
Implementing jsp tag extensions
 
Expression language
Expression languageExpression language
Expression language
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
Java servlets
Java servletsJava servlets
Java servlets
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtap
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
 
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
 
Architectural patterns part 4
Architectural patterns part 4Architectural patterns part 4
Architectural patterns part 4
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
JSP Processing
JSP ProcessingJSP Processing
JSP Processing
 
Mule overview
Mule overviewMule overview
Mule overview
 
Jsp
JspJsp
Jsp
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 

Similar a Types of MessageRouting in Mule

Similar a Types of MessageRouting in Mule (20)

Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
 
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
 
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control reference
 
Controlling message flow
Controlling message flowControlling message flow
Controlling message flow
 
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
 
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
 
Module 5 APP+Sess+Pres layer.pptx
Module 5 APP+Sess+Pres layer.pptxModule 5 APP+Sess+Pres layer.pptx
Module 5 APP+Sess+Pres layer.pptx
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestration
 
Elements in a mule flow
Elements in a mule flowElements in a mule flow
Elements in a mule flow
 

Más de VenkataNaveen Kumar (6)

Difference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxwsDifference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxws
 
Configuring mule jms_withweblogicjms
Configuring mule jms_withweblogicjmsConfiguring mule jms_withweblogicjms
Configuring mule jms_withweblogicjms
 
Munit_in_mule_naveen
Munit_in_mule_naveenMunit_in_mule_naveen
Munit_in_mule_naveen
 
Thread Management In Mule
Thread Management In MuleThread Management In Mule
Thread Management In Mule
 
Mule soft csv_toxml
Mule soft csv_toxmlMule soft csv_toxml
Mule soft csv_toxml
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data FilteringMuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
 

Último

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Types of MessageRouting in Mule

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