SlideShare a Scribd company logo
1 of 12
Mule Concepts
Elements in a Mule Flow :
Exception Strategies
• Mule provides numerous options for handling errors.
• Errors, or faults, that occur within Mule are referred
to as exceptions.
• To manage these exceptions, Mule allows you to
configure exception strategies.
• Mule’s default exception strategy — which implicitly applies
to all Mule applications — manages errors (such as, thrown
exceptions) in Mule flows.
• When your flows require more sophisticated error
management, you can implement one or more exception
strategies to construct precise, efficient protocols for handling
errors.
Elements in a Mule Flow:
Exception Strategies
• Errors that occur in Mule fall into one of two
categories:
– System Exceptions
– Messaging Exceptions.
Elements in a Mule Flow:
Exception Strategies
• System Exceptions :
– Mule invokes a System Exception Strategy when an exception is
thrown at the system-level i.e. when no message is involved,
exceptions are handled by system exception strategies.
– E.g. system exception strategies handle exceptions that occur:
• During application start-up.
• When a connection to an external system fails.
– When a system exception occurs
• Mule sends an exception notification to registered listeners
• logs the exception
• if the exception was caused by a connection failure — executes the reconnection
strategy.
– System Exception Strategies are not configurable in Mule.
– Example : Imagine Mule establishes a connection to a JMS broker in
order to receive a message. When Mule attempts to use the
connection to consume a message the connection fails, which causes
Mule to invoke the system exception strategy. Because the failure
occurred before any message was received for processing, Mule
invoked the system, rather than messaging, exception strategy.
Elements in a Mule Flow:
Exception Strategies
• Messaging Exceptions:
– Mule invokes a Messaging Exception Strategy whenever an exception
is thrown within a flow.
– Whenever a message is involved, exceptions are handled
by messaging exception strategies.
– When a message being processed through a Mule flow throws an
exception,
• normal flow execution stops.
• Mule transfers the message to the message processor sequence within the
exception strategy.
– You can incorporate any number of message processors into an
exception strategy to handle the exception precisely as you wish.
Elements in a Mule Flow:
Exception Strategies
• Messaging Exceptions:
– Below diagram displays how exception strategy behaves, when a
Messaging Exception occurs.
Elements in a Mule Flow:
Exception Strategies
• Mule supports five types of messaging exception
strategies, each of which is capable of handling
errors that occur in flows which process transactions.
• Below are the Exception Strategies
– Catch Exception Strategy
– Choice Exception Strategy
– Default Exception Strategy
– Reference Exception Strategy
– Rollback Exception Strategy
Elements in a Mule Flow:
Exception Strategies
• Catch Exception Strategy :
– Customizes the way Mule handles any exception.
– Catch exception strategies consume inbound messages, as opposed to
rolling them back.
– Transaction Error Handling :
• When a message throws an exception, the catch exception strategy alwayscommits
the transaction and consumes the message.
• Choice Exception Strategy :
– Customizes the way Mule handles a message that throws an exception
based on the message’s content at the moment it throws the
exception.
– Transaction Error Handling :
• the choice exception strategy makes a decision about where to route the message
for further processing. (The choice exception strategy itself never actually performs
any rollback, commit, or consume activities.)
Elements in a Mule Flow:
Exception Strategies
• Default Exception Strategy :
– Provides an implicit default to handle all messaging exceptions that
are thrown in Mule applications.
– Transaction Error Handling :
• Mule automatically rolls back any pending transaction and logs the exception.
• If no transaction is involved, the default exception strategy simply logs the
exception.
• Reference Exception Strategy :
– Refers and adheres to the error handling parameters defined in a
global catch, rollback, or choice exception strategy.
– Transaction Error Handling :
• the reference exception strategy refers and adheres to the error handling
parameters defined in a global catch, rollback, or choice exception strategy. (The
reference exception strategy itself never actually performs any rollback, commit, or
consume activities.)
Elements in a Mule Flow:
Exception Strategies
• Rollback Exception Strategy :
– Ensures that a message that throws an exception in a flow is rolled
back for reprocessing (if the message source supports redelivery).
– Rollback exception strategies do not consume inbound messages.
– Transaction Error Handling :
• the rollback exception strategy makes one or more attempts to rollback the
message and redeliver it for processing (if the message source supports redelivery).
• If the message exceeds its redelivery attempts, then the rollback exception strategy
commits the failed transaction and consumes the message.
Elements in a Mule Flow:
Exception Strategies
• Characteristics of Exception Strategy :
– Each flow can contain only one exception strategy.
– Each exception strategy can contain any number of message
processors.
– Choice exception strategies can contain one or more catch and/or
rollback exception strategies. (Rollback and catch exception strategies
cannot, however, contain other exception strategies.)
– You can create one or more global exception strategies to reuse in
flows throughout your entire Mule application.
– A Transactional Scope may include its own exception strategy,
regardless of what you define at Flow level.
Elements in a Mule Flow:
Exception Strategies
• Example (See the Notes for flow xml):
Elements in a Mule Flow:
Exception Strategies

More Related Content

What's hot

Mule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategyMule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategyAnkush Sharma
 
Mule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception StrategyMule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception StrategyAnkush Sharma
 
Exception handling in mule
Exception handling in muleException handling in mule
Exception handling in mulenagarajupatangay
 
Exception strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioException strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioJitendra Bafna
 

What's hot (6)

Mule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategyMule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategy
 
Mule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception StrategyMule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception Strategy
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Exception handling in mule
Exception handling in muleException handling in mule
Exception handling in mule
 
Exception strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioException strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint Studio
 

Similar to Mule concepts exception strategies

Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategiesKrishna_in
 
Error handling
Error handlingError handling
Error handlingkrishashi
 
A short introduction on error handling in anypoint studio
A short introduction on error handling in anypoint studioA short introduction on error handling in anypoint studio
A short introduction on error handling in anypoint studioSwapnil Sahu
 
Mule error handling
Mule  error handlingMule  error handling
Mule error handlingchandu1443
 
Mule error handling_rollback exception strategy
Mule error handling_rollback exception strategyMule error handling_rollback exception strategy
Mule error handling_rollback exception strategykunal vishe
 
Vancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVikalp Bhalia
 
Mule exception strategies - Choice Exception Strategy
Mule exception strategies - Choice Exception StrategyMule exception strategies - Choice Exception Strategy
Mule exception strategies - Choice Exception StrategyAnkush Sharma
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategiesD.Rajesh Kumar
 
Exception handling basics in mule
Exception handling basics in muleException handling basics in mule
Exception handling basics in mulehimajareddys
 
Synchronous verses asynchronous processing strategy in mule esb
Synchronous verses asynchronous processing strategy in mule esbSynchronous verses asynchronous processing strategy in mule esb
Synchronous verses asynchronous processing strategy in mule esbVishnuAnji
 
1st Feb 2020 MuleSoft Meetup
1st Feb 2020 MuleSoft Meetup1st Feb 2020 MuleSoft Meetup
1st Feb 2020 MuleSoft MeetupPankaj Goyal
 
Muleflowarchitecturepart2
Muleflowarchitecturepart2Muleflowarchitecturepart2
Muleflowarchitecturepart2vijaynerd
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingManish Kumar Yadav
 
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Exception handling in Mule 4 �_Virtual mule soft meetup may_2020Exception handling in Mule 4 �_Virtual mule soft meetup may_2020
Exception handling in Mule 4 _Virtual mule soft meetup may_2020Om Prakash
 
Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020Om Prakash
 
Mule scopes&error handling
Mule scopes&error handlingMule scopes&error handling
Mule scopes&error handlingSumit Gole
 
Mule esb flow processing strategies
Mule esb flow processing strategiesMule esb flow processing strategies
Mule esb flow processing strategieshimajareddys
 

Similar to Mule concepts exception strategies (20)

Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Error handling
Error handlingError handling
Error handling
 
A short introduction on error handling in anypoint studio
A short introduction on error handling in anypoint studioA short introduction on error handling in anypoint studio
A short introduction on error handling in anypoint studio
 
Mule error handling
Mule  error handlingMule  error handling
Mule error handling
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Mule exceptions Strategy
Mule exceptions StrategyMule exceptions Strategy
Mule exceptions Strategy
 
Mule error handling_rollback exception strategy
Mule error handling_rollback exception strategyMule error handling_rollback exception strategy
Mule error handling_rollback exception strategy
 
Vancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-july
 
Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
 
Mule exception strategies - Choice Exception Strategy
Mule exception strategies - Choice Exception StrategyMule exception strategies - Choice Exception Strategy
Mule exception strategies - Choice Exception Strategy
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
 
Exception handling basics in mule
Exception handling basics in muleException handling basics in mule
Exception handling basics in mule
 
Synchronous verses asynchronous processing strategy in mule esb
Synchronous verses asynchronous processing strategy in mule esbSynchronous verses asynchronous processing strategy in mule esb
Synchronous verses asynchronous processing strategy in mule esb
 
1st Feb 2020 MuleSoft Meetup
1st Feb 2020 MuleSoft Meetup1st Feb 2020 MuleSoft Meetup
1st Feb 2020 MuleSoft Meetup
 
Muleflowarchitecturepart2
Muleflowarchitecturepart2Muleflowarchitecturepart2
Muleflowarchitecturepart2
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handling
 
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Exception handling in Mule 4 �_Virtual mule soft meetup may_2020Exception handling in Mule 4 �_Virtual mule soft meetup may_2020
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
 
Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020
 
Mule scopes&error handling
Mule scopes&error handlingMule scopes&error handling
Mule scopes&error handling
 
Mule esb flow processing strategies
Mule esb flow processing strategiesMule esb flow processing strategies
Mule esb flow processing strategies
 

More from kunal vishe

Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10kunal vishe
 
Mule data weave_7
Mule data weave_7Mule data weave_7
Mule data weave_7kunal vishe
 
Mule data weave_8
Mule data weave_8Mule data weave_8
Mule data weave_8kunal vishe
 
Mule data weave_6
Mule data weave_6Mule data weave_6
Mule data weave_6kunal vishe
 
Mule data weave_5
Mule data weave_5Mule data weave_5
Mule data weave_5kunal vishe
 
Mule data weave_4
Mule data weave_4Mule data weave_4
Mule data weave_4kunal vishe
 
Mule data weave_3
Mule data weave_3Mule data weave_3
Mule data weave_3kunal vishe
 
Mule data weave_2
Mule data weave_2Mule data weave_2
Mule data weave_2kunal vishe
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scopekunal vishe
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scopekunal vishe
 
Mule scopes async_scope
Mule scopes async_scopeMule scopes async_scope
Mule scopes async_scopekunal vishe
 
Mule debugging logging_configuration_in_mule
Mule debugging logging_configuration_in_muleMule debugging logging_configuration_in_mule
Mule debugging logging_configuration_in_mulekunal vishe
 
Mule debugging logging_in_mule
Mule debugging logging_in_muleMule debugging logging_in_mule
Mule debugging logging_in_mulekunal vishe
 

More from kunal vishe (20)

Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
 
Mule data weave_7
Mule data weave_7Mule data weave_7
Mule data weave_7
 
Mule data weave_8
Mule data weave_8Mule data weave_8
Mule data weave_8
 
Mule data weave_6
Mule data weave_6Mule data weave_6
Mule data weave_6
 
Mule data weave_5
Mule data weave_5Mule data weave_5
Mule data weave_5
 
Mule data weave_4
Mule data weave_4Mule data weave_4
Mule data weave_4
 
Mule data weave_3
Mule data weave_3Mule data weave_3
Mule data weave_3
 
Mule data weave_2
Mule data weave_2Mule data weave_2
Mule data weave_2
 
Mule mel 5_tips
Mule mel 5_tipsMule mel 5_tips
Mule mel 5_tips
 
Mule mel 4_tips
Mule mel 4_tipsMule mel 4_tips
Mule mel 4_tips
 
Mule mel 3
Mule mel 3Mule mel 3
Mule mel 3
 
Mule mel 2
Mule mel 2Mule mel 2
Mule mel 2
 
Mule mel 1
Mule mel 1Mule mel 1
Mule mel 1
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scope
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
 
Mule scopes async_scope
Mule scopes async_scopeMule scopes async_scope
Mule scopes async_scope
 
Mule scopes 2
Mule scopes 2Mule scopes 2
Mule scopes 2
 
Mule scopes 1
Mule scopes 1Mule scopes 1
Mule scopes 1
 
Mule debugging logging_configuration_in_mule
Mule debugging logging_configuration_in_muleMule debugging logging_configuration_in_mule
Mule debugging logging_configuration_in_mule
 
Mule debugging logging_in_mule
Mule debugging logging_in_muleMule debugging logging_in_mule
Mule debugging logging_in_mule
 

Recently uploaded

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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 Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI 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 Graph
 
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
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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 Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
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
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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 ...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Mule concepts exception strategies

  • 1. Mule Concepts Elements in a Mule Flow : Exception Strategies
  • 2. • Mule provides numerous options for handling errors. • Errors, or faults, that occur within Mule are referred to as exceptions. • To manage these exceptions, Mule allows you to configure exception strategies. • Mule’s default exception strategy — which implicitly applies to all Mule applications — manages errors (such as, thrown exceptions) in Mule flows. • When your flows require more sophisticated error management, you can implement one or more exception strategies to construct precise, efficient protocols for handling errors. Elements in a Mule Flow: Exception Strategies
  • 3. • Errors that occur in Mule fall into one of two categories: – System Exceptions – Messaging Exceptions. Elements in a Mule Flow: Exception Strategies
  • 4. • System Exceptions : – Mule invokes a System Exception Strategy when an exception is thrown at the system-level i.e. when no message is involved, exceptions are handled by system exception strategies. – E.g. system exception strategies handle exceptions that occur: • During application start-up. • When a connection to an external system fails. – When a system exception occurs • Mule sends an exception notification to registered listeners • logs the exception • if the exception was caused by a connection failure — executes the reconnection strategy. – System Exception Strategies are not configurable in Mule. – Example : Imagine Mule establishes a connection to a JMS broker in order to receive a message. When Mule attempts to use the connection to consume a message the connection fails, which causes Mule to invoke the system exception strategy. Because the failure occurred before any message was received for processing, Mule invoked the system, rather than messaging, exception strategy. Elements in a Mule Flow: Exception Strategies
  • 5. • Messaging Exceptions: – Mule invokes a Messaging Exception Strategy whenever an exception is thrown within a flow. – Whenever a message is involved, exceptions are handled by messaging exception strategies. – When a message being processed through a Mule flow throws an exception, • normal flow execution stops. • Mule transfers the message to the message processor sequence within the exception strategy. – You can incorporate any number of message processors into an exception strategy to handle the exception precisely as you wish. Elements in a Mule Flow: Exception Strategies
  • 6. • Messaging Exceptions: – Below diagram displays how exception strategy behaves, when a Messaging Exception occurs. Elements in a Mule Flow: Exception Strategies
  • 7. • Mule supports five types of messaging exception strategies, each of which is capable of handling errors that occur in flows which process transactions. • Below are the Exception Strategies – Catch Exception Strategy – Choice Exception Strategy – Default Exception Strategy – Reference Exception Strategy – Rollback Exception Strategy Elements in a Mule Flow: Exception Strategies
  • 8. • Catch Exception Strategy : – Customizes the way Mule handles any exception. – Catch exception strategies consume inbound messages, as opposed to rolling them back. – Transaction Error Handling : • When a message throws an exception, the catch exception strategy alwayscommits the transaction and consumes the message. • Choice Exception Strategy : – Customizes the way Mule handles a message that throws an exception based on the message’s content at the moment it throws the exception. – Transaction Error Handling : • the choice exception strategy makes a decision about where to route the message for further processing. (The choice exception strategy itself never actually performs any rollback, commit, or consume activities.) Elements in a Mule Flow: Exception Strategies
  • 9. • Default Exception Strategy : – Provides an implicit default to handle all messaging exceptions that are thrown in Mule applications. – Transaction Error Handling : • Mule automatically rolls back any pending transaction and logs the exception. • If no transaction is involved, the default exception strategy simply logs the exception. • Reference Exception Strategy : – Refers and adheres to the error handling parameters defined in a global catch, rollback, or choice exception strategy. – Transaction Error Handling : • the reference exception strategy refers and adheres to the error handling parameters defined in a global catch, rollback, or choice exception strategy. (The reference exception strategy itself never actually performs any rollback, commit, or consume activities.) Elements in a Mule Flow: Exception Strategies
  • 10. • Rollback Exception Strategy : – Ensures that a message that throws an exception in a flow is rolled back for reprocessing (if the message source supports redelivery). – Rollback exception strategies do not consume inbound messages. – Transaction Error Handling : • the rollback exception strategy makes one or more attempts to rollback the message and redeliver it for processing (if the message source supports redelivery). • If the message exceeds its redelivery attempts, then the rollback exception strategy commits the failed transaction and consumes the message. Elements in a Mule Flow: Exception Strategies
  • 11. • Characteristics of Exception Strategy : – Each flow can contain only one exception strategy. – Each exception strategy can contain any number of message processors. – Choice exception strategies can contain one or more catch and/or rollback exception strategies. (Rollback and catch exception strategies cannot, however, contain other exception strategies.) – You can create one or more global exception strategies to reuse in flows throughout your entire Mule application. – A Transactional Scope may include its own exception strategy, regardless of what you define at Flow level. Elements in a Mule Flow: Exception Strategies
  • 12. • Example (See the Notes for flow xml): Elements in a Mule Flow: Exception Strategies

Editor's Notes

  1. <mule xmlns:spring="http://www.springframework.org/schema/beans"     xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd"> <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="11081" doc:name="HTTP Listener Configuration"/> <flow name="loan-broker-sync">         <description>             The main loan broker flow:             1) Receives a customer request             2) Performs a lookup of the customer credit profile using a component             binding             3) Determines the bank that should be used to request quotes             4) Sends the request to the selected banks and aggregates responses             5) Selects the lowest quote from the list of quotes             6) Returns the response to the client         </description>         <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>         <choice doc:name="Choice">             <when expression="!(payload.name == null || payload.ssn == null || payload.amount == null || payload.term == null)">                 <expression-component doc:name="create customer request"> <![CDATA[import org.mule.example.loanbroker.message.CustomerQuoteRequest; import org.mule.example.loanbroker.model.Customer; payload = new CustomerQuoteRequest(new Customer(payload.name, Integer.parseInt(payload.ssn)), Integer.parseInt(payload.amount), Integer.parseInt(payload.term));]]></expression-component>                 <enricher doc:name="Enrich with creditProfile" source="#[payload]" target="#[flowVars.creditProfile]">                     <flow-ref doc:name="lookupCustomerCreditProfile" name="loan-broker-sync"/>                 </enricher>                 <enricher doc:name="Enrich with banks" source="#[payload]" target="#[flowVars.banks]">                     <flow-ref doc:name="lookupBanks" name="loan-broker-sync"/>                 </enricher>                 <set-variable doc:name="create empty quotes" value="#[new java.util.LinkedList()]" variableName="quotes"/>                 <foreach collection="#[flowVars.banks]" doc:name="Foreach">                     <enricher doc:name="Message Enricher" target="#[quotes.add($)]">                         <flow-ref doc:name="lookupLoanQuote" name="loan-broker-sync"/>                     </enricher>                 </foreach>                 <flow-ref doc:name="findLowestLoanQuote" name="loan-broker-sync"/>                 <object-to-string-transformer doc:name="Object to String"/>             </when>             <otherwise>                 <expression-component doc:name="set error message">                 <![CDATA[payload="Error: incomplete request"]]></expression-component>             </otherwise>         </choice>         <catch-exception-strategy doc:name="Catch Exception Strategy">             <set-payload doc:name="Set error message" value="Error processing loan request"/>         </catch-exception-strategy>     </flow> </mule>