SlideShare a Scribd company logo
1 of 21
By : Sumit Gole
Date : 09 Nov 2015
Mule Architecture
Component
●
Anypoint Platform - Transform your business with API-led
connectivity.
●
Mule runtime engine - Deploy an ESB, iPaaS or API gateway on
a single, unified runtime.
●
Studio - Connect apps and data on our powerful IDE
●
API Designer - Build, design and test enterprise grade APIs,
using RAML.
●
API Manager - Generate proxies, or apply pre-built or custom
policies with clicks.
●
Analytics - Get real-time views on API consumption and
performance.
●
API Portal - Create a rich onramp for your API with docs, sample
code, and interactive tools.
Mule scopes.
https://docs.mulesoft.com/mule-fundamentals/v/3.7/mule-filters-scopes-and-routers
Scopes
●
Scopes are the wrappers on a process flow. Type of scopes
●
Async :The child flow receives a message, it immediately sends
one copyof that message to the next message processor in the
parent flow.
●
●
●
●
●
●
●
Though the copy of messaage is passed to Async flow but
payload is not copied i.e. if async flow change the payload then
those changes are reflected in the original flow also.
till
Scopes
●
Sync :the main flow halts, and all the message processors in the
child flow execute before the parent flow resumes processing.
●
Cache: caches the subflow output for reusability.
●
How this works?
●
Mule genrate a key corresponding to a message’s payload.
●
Cache scope checks the value corresponding to key.
●
If key exist then corresponding value is passed without
executing the flow.
●
Else the value present in the memory iss passed.
Scopes
●
Configuring an Object Store
●
Custome object store: create custome class to store the
cached responses.
●
In-memory-store: by configureing properties use in memory
option to store the object.
●
Managed-store: store the cached responses in a place
defined by ListableObjectStore.
●
Simple-text-file-store: Store the object in a file.
Scopes
●
Composite source:Accept messages from multiple input
channels and pass the payload to message processors.
●
Scopes
●
Message Enricher: Used to enrich the incoming message with
additional information.
Eg:
●
<flow name="orderProcessingFlow">
●
<inbound-endpoint ref="orderEndpoint"/>
●
<enricher target="#[variable:state]">
●
<outbound-endpoint ref="stateLookup"/>
●
</enricher>
●
<outbound-endpoint ref="orderStep2"/>
●
</flow>
Mule currently supports enrichment of flow variables and
message headers only.
Scopes
●
Foreach : splits a collection in to elements and process
individusal element using the processor in the scope.
Eg:
●
●
Scopes
●
Transactional: execute a flow as a single unit i.e. series of steps
in a flow must succeed or fail as one unit.
●
Following connectors support transactional demarcation:
●
JMS
●
JDBC (Deprecated)
●
VM
●
Scopes
●
Transactional tips:
Operations that occur inside a transaction execute
synchronously.
Scope is from first outbound connector to next outbound
connector.
Scopes
●
Until Successful: scope processes messages through the
processors within it until the process succeeds.
●
<until-successful objectStore-ref="objectStore" maxRetries="5"
secondsBetweenRetries="60" doc:name="Until Successful">
---------
</until-successful>
●
Configuring a Dead Letter Queue: If maxRetries exhausted
then can define a DLQ (dead letter queue) endpoint to which
Mule can send such messages.
Exception Handling
●
When ever any activity in mule instance fails then mule throws
an exception. Mule exceptions are categorised in two parts.
●
System Exceptions
●
Messaging Exceptions
●
System Exceptions :
●
For instance exceptions occures during application startup.
●
When a connection to external system fails.
Eg: Before receving any message , Mule tries to connect to any
messaging server and get exception. Then this is called system
exception.
System Exception strategy is not configurable in mule.
Exception Handling
●
When ever any activity in mule instance fails then mule throws
an exception. Mule exceptions are categorised in two parts.
●
System Exceptions
●
Messaging Exceptions
●
System Exceptions :
●
For instance exceptions occures during application startup.
●
When a connection to external system fails.
Exception Handling
●
Messaging Exceptions : While processing the payload if any
exception occures then cooresponding defined exception
strategy is executed.
●
Exception Handling
●
Messaging Exceptions : Five ways to configure messaging
exceptions.
●
Default Exception Strategy : Implicitly and globally handles all
messaging exceptions that are thrown in Mule applications.
●
●
Catch Exception Strategy : It catches all the exceptions
thrown by the parent flow.
●
Exception Handling
●
Choice Exceptions : Catches all the exceptions of parent flow and
on the bases of message content route the message to
appropriate exception strategy.
●
Rollback Exception Strategy: For transactional flow if exception
occures then it rollback the transaction in the flow.
●
The rollback exception strategy catches the exception and rolls
the message back for reprocessing; the message throws an
error again, the rollback exception strategy catches the
exception again
Exception Handling
●
Rollback Exception Strategy: There are two ways to handle two
exceptions.
●
One way: instructs the inbound connector transport to execute
corrective actions.
●
Request and response: changes the payload of a message and
returns it to the client.
Exception Handling
●
Reference Exception Strategy: is used to refer the Global
exception strategy in flows.
Eg:
Mule Error handling.
https://docs.mulesoft.com/mule-fundamentals/v/3.7/mule-exception-strategies

More Related Content

What's hot (9)

Sftplite
SftpliteSftplite
Sftplite
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Process and Threads in JAVA
Process and Threads in JAVAProcess and Threads in JAVA
Process and Threads in JAVA
 
Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Fluxxor react library
Fluxxor react libraryFluxxor react library
Fluxxor react library
 
Object store
Object storeObject store
Object store
 
Prometheus workshop
Prometheus workshopPrometheus workshop
Prometheus workshop
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 

Similar to Mule scopes&amp;error handling

MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019Subhash Patel
 
Mule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error HandlingMule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error Handlingsatyasekhar123
 
Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Srikanth N
 
Red Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseRed Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseAdrian Gigante
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataGetInData
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTSabrina Marechal
 
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...CodeScience
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideMohanraj Thirumoorthy
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorLili Cosic
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Jimmy DeadcOde
 
MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019Ieva Navickaite
 
QueueMetrics - Tips and Tricks
QueueMetrics - Tips and TricksQueueMetrics - Tips and Tricks
QueueMetrics - Tips and TricksClarotech_Events
 
Zero downtime deployments for Sling application using Docker
Zero downtime deployments for Sling application using DockerZero downtime deployments for Sling application using Docker
Zero downtime deployments for Sling application using DockerRobert Munteanu
 
Zero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerZero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerTomasz Rękawek
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in muleAnkit Lawaniya
 
AdroitLogic UltraESB
AdroitLogic UltraESBAdroitLogic UltraESB
AdroitLogic UltraESBAdroitLogic
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN ControllerSumit Arora
 
python_development.pptx
python_development.pptxpython_development.pptx
python_development.pptxLemonReddy1
 

Similar to Mule scopes&amp;error handling (20)

Mule Complete Training
Mule Complete TrainingMule Complete Training
Mule Complete Training
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
 
Mule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error HandlingMule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error Handling
 
Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2Mule ESB Tutorial Part 2
Mule ESB Tutorial Part 2
 
Red Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseRed Hat Open Day JBoss Fuse
Red Hat Open Day JBoss Fuse
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
 
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...
Technical Webinar: Patterns for Integrating Your Salesforce App with Off-Plat...
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's Guide
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operator
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
 
MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019
 
Event driven-arch
Event driven-archEvent driven-arch
Event driven-arch
 
QueueMetrics - Tips and Tricks
QueueMetrics - Tips and TricksQueueMetrics - Tips and Tricks
QueueMetrics - Tips and Tricks
 
Zero downtime deployments for Sling application using Docker
Zero downtime deployments for Sling application using DockerZero downtime deployments for Sling application using Docker
Zero downtime deployments for Sling application using Docker
 
Zero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerZero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using Docker
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
 
AdroitLogic UltraESB
AdroitLogic UltraESBAdroitLogic UltraESB
AdroitLogic UltraESB
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
python_development.pptx
python_development.pptxpython_development.pptx
python_development.pptx
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Mule scopes&amp;error handling

  • 1. By : Sumit Gole Date : 09 Nov 2015
  • 3. Component ● Anypoint Platform - Transform your business with API-led connectivity. ● Mule runtime engine - Deploy an ESB, iPaaS or API gateway on a single, unified runtime. ● Studio - Connect apps and data on our powerful IDE ● API Designer - Build, design and test enterprise grade APIs, using RAML. ● API Manager - Generate proxies, or apply pre-built or custom policies with clicks. ● Analytics - Get real-time views on API consumption and performance. ● API Portal - Create a rich onramp for your API with docs, sample code, and interactive tools.
  • 5. Scopes ● Scopes are the wrappers on a process flow. Type of scopes ● Async :The child flow receives a message, it immediately sends one copyof that message to the next message processor in the parent flow. ● ● ● ● ● ● ● Though the copy of messaage is passed to Async flow but payload is not copied i.e. if async flow change the payload then those changes are reflected in the original flow also. till
  • 6. Scopes ● Sync :the main flow halts, and all the message processors in the child flow execute before the parent flow resumes processing. ● Cache: caches the subflow output for reusability. ● How this works? ● Mule genrate a key corresponding to a message’s payload. ● Cache scope checks the value corresponding to key. ● If key exist then corresponding value is passed without executing the flow. ● Else the value present in the memory iss passed.
  • 7. Scopes ● Configuring an Object Store ● Custome object store: create custome class to store the cached responses. ● In-memory-store: by configureing properties use in memory option to store the object. ● Managed-store: store the cached responses in a place defined by ListableObjectStore. ● Simple-text-file-store: Store the object in a file.
  • 8. Scopes ● Composite source:Accept messages from multiple input channels and pass the payload to message processors. ●
  • 9. Scopes ● Message Enricher: Used to enrich the incoming message with additional information. Eg: ● <flow name="orderProcessingFlow"> ● <inbound-endpoint ref="orderEndpoint"/> ● <enricher target="#[variable:state]"> ● <outbound-endpoint ref="stateLookup"/> ● </enricher> ● <outbound-endpoint ref="orderStep2"/> ● </flow> Mule currently supports enrichment of flow variables and message headers only.
  • 10. Scopes ● Foreach : splits a collection in to elements and process individusal element using the processor in the scope. Eg: ● ●
  • 11. Scopes ● Transactional: execute a flow as a single unit i.e. series of steps in a flow must succeed or fail as one unit. ● Following connectors support transactional demarcation: ● JMS ● JDBC (Deprecated) ● VM ●
  • 12. Scopes ● Transactional tips: Operations that occur inside a transaction execute synchronously. Scope is from first outbound connector to next outbound connector.
  • 13. Scopes ● Until Successful: scope processes messages through the processors within it until the process succeeds. ● <until-successful objectStore-ref="objectStore" maxRetries="5" secondsBetweenRetries="60" doc:name="Until Successful"> --------- </until-successful> ● Configuring a Dead Letter Queue: If maxRetries exhausted then can define a DLQ (dead letter queue) endpoint to which Mule can send such messages.
  • 14. Exception Handling ● When ever any activity in mule instance fails then mule throws an exception. Mule exceptions are categorised in two parts. ● System Exceptions ● Messaging Exceptions ● System Exceptions : ● For instance exceptions occures during application startup. ● When a connection to external system fails. Eg: Before receving any message , Mule tries to connect to any messaging server and get exception. Then this is called system exception. System Exception strategy is not configurable in mule.
  • 15. Exception Handling ● When ever any activity in mule instance fails then mule throws an exception. Mule exceptions are categorised in two parts. ● System Exceptions ● Messaging Exceptions ● System Exceptions : ● For instance exceptions occures during application startup. ● When a connection to external system fails.
  • 16. Exception Handling ● Messaging Exceptions : While processing the payload if any exception occures then cooresponding defined exception strategy is executed. ●
  • 17. Exception Handling ● Messaging Exceptions : Five ways to configure messaging exceptions. ● Default Exception Strategy : Implicitly and globally handles all messaging exceptions that are thrown in Mule applications. ● ● Catch Exception Strategy : It catches all the exceptions thrown by the parent flow. ●
  • 18. Exception Handling ● Choice Exceptions : Catches all the exceptions of parent flow and on the bases of message content route the message to appropriate exception strategy. ● Rollback Exception Strategy: For transactional flow if exception occures then it rollback the transaction in the flow. ● The rollback exception strategy catches the exception and rolls the message back for reprocessing; the message throws an error again, the rollback exception strategy catches the exception again
  • 19. Exception Handling ● Rollback Exception Strategy: There are two ways to handle two exceptions. ● One way: instructs the inbound connector transport to execute corrective actions. ● Request and response: changes the payload of a message and returns it to the client.
  • 20. Exception Handling ● Reference Exception Strategy: is used to refer the Global exception strategy in flows. Eg: