SlideShare a Scribd company logo
Manirathnam G
Anypoint Studio – Mule ESB
Error Handling
Index
Filter Types
Error Handling
System Exception
Messaging Exception
Messaging Exception – Types of
Strategies
Messaging Exception Strategies -
Characteristics
Other Ways of Handling Errors
Error Handling
Introduction
 Mule ESB provides numerous options for handling errors. Faults that occur
within Mule are referred to as exceptions;
 When an activity in Mule instance fails, Mule throws an exception. To
manage these exceptions, Mule allows to configure exception strategies.
 Mule’s default exception strategy — which implicitly applies to all Mule
applications — manages errors (i.e. thrown exceptions) in Mule flows.
 When flows require more sophisticated error management, can
implement one or more exception strategies to construct precise, efficient
protocols for handling errors.
 From a high level perspective, errors that occur in Mule fall into one of
two categories:
 System Exceptions, and
 Messaging Exceptions
System Exception
• 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). For example, system exception strategies handle
exceptions that occur:
• during application start-up
• when a connection to an external system fails
• When a system exception strategy occurs, Mule sends an exception
notification to registered listeners, logs the exception, and — if the
exception was caused by a connection failure — executes the reconnection
strategy. System Exception Strategies are not configurable in Mule.
Example Scenario:
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.
System Exception
Messaging Exception
• Mule invokes a Messaging Exception Strategy whenever an exception is
thrown within a flow (i.e., 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 and processes transfers to the message processor
sequence within the exception strategy. We can incorporate any number of
message processors – and in one case, other exception strategies – into an
exception strategy to handle the exception precisely.
Messaging Exception
Messaging Exception – Types of Strategies
Exception
Strategy
Use Transaction Error Handling
Default
exception
strategy
Defined and implicitly applied by default
to handle all messaging exceptions that
are thrown in Mule applications
When a message throws an exception, the
default exception strategy rolls back the
message and logs the exception.
Catch
exception
strategy
Define a catch exception strategy to
customize the way Mule handles any
exception. Catch exception strategies
consume inbound messages. (Mule’s
catch exception strategy behavior is
similar to a Java catch block.)
When a message throws an exception, the
catch exception strategy always commits
the transaction and consumes the
message.
Rollback
exception
strategy
Define a rollback exception strategy to
ensure 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.
When a message throws an exception, 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.
Messaging Exception – Types of Strategies (Contd)
Exception
Strategy
Use Transaction Error Handling
Reference
exception
strategy
Define a reference exception strategy to
refer and adhere to the error handling
parameters defined in a global catch,
rollback or choice exception strategy.
When a message throws an exception, 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.)
Choice
exception
strategy
Define a choice exception strategy to
customize the way Mule handles a
message that throws an exception
based on the message’s content at the
moment it throws the exception.
When a message throws an exception, 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.)
Messaging Exception Strategies - Characteristics
Characteristics of messaging exception strategies:
 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.)
Other Ways of Handling Errors
Until Successful Scope
 Until Successful behaves similarly to a rollback exception strategy.
 This scope attempts to route a message through its child flow until the
message is processed successfully. However, we can define the maximum
number of processing attempts the Until Successful scope undertakes before it
reverts to handling the message as though it were an exception.
 We can configure a Failure Expression, an Ack Expression, or a Dead Letter
Queue Reference to instruct the scope on how to manage messages that it
cannot process. In this respect, Until Successful scope behavior is similar to a
rollback exception strategy.
Exception Filter
 Mule’s Exception filter stops normal flow execution when it discovers a
message that contains a message in the “exceptionPayload” field.
 By comparison, an exception strategy typically stops normal flow execution
when a message throws an exception in the flow. We can combine the two
and configure the exception filter to stop normal flow execution and throw an
exception, which triggers the exception strategy.
Other Ways of Handling Errors (Contd)
Reconnection Strategies
 Mule’s Reconnection Strategies specify how a connector behaves when its
connection fails.
 We can control how Mule attempts to reconnect by specifying a number of
criteria: the type of exception, the number and frequency of reconnection
attempts, the notifications generated, and more.
 With a reconnection strategy, can better control the behavior of a failed
connection by configuring it, for example, to reattempt the connection only
once every 15 minutes, and to stop trying to reconnect after 10 attempts.
 Reconnection strategy behavior resembles that of exception strategies, but
reconnection strategies provide instructions specifically for — and limited to
— reconnection attempts.
Eg: <jms:activemq-connector name="AMQConnector"><reconnect count="5" frequency="1000"/></jms:activemq-
connector>
CXF Error Handling
 Web services that utilize CXF can implement Mule exception strategies (such
as the Catch and Rollback exception strategies) that are compatible with CXF.
Thank you

More Related Content

Viewers also liked

Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
Naresh Chintalcheru
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
Rich Software
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoft
MuleSoft
 
Batch processing
Batch processingBatch processing
Batch processing
bapiraju
 
Security components in mule esb
Security components in mule esbSecurity components in mule esb
Security components in mule esb
himajareddys
 
Integration patterns in muleesb
Integration patterns in muleesbIntegration patterns in muleesb
Integration patterns in muleesb
himajareddys
 
Mule architecture styles
Mule architecture stylesMule architecture styles
Mule architecture styles
himajareddys
 
SOLANCA Tennis Academy
SOLANCA Tennis AcademySOLANCA Tennis Academy
SOLANCA Tennis AcademyDaniel Camacho
 
Poly dcem3-ohphtalmo 2016
Poly   dcem3-ohphtalmo 2016Poly   dcem3-ohphtalmo 2016
Poly dcem3-ohphtalmo 2016
hajoura1971
 
Poly dcem2-endocrino
Poly   dcem2-endocrinoPoly   dcem2-endocrino
Poly dcem2-endocrino
hajoura1971
 
Poly dcem2-chirurgie-2016
Poly   dcem2-chirurgie-2016Poly   dcem2-chirurgie-2016
Poly dcem2-chirurgie-2016
hajoura1971
 
CV of Md. Golam Robbani_ RUET -IPE
CV of Md. Golam Robbani_ RUET -IPECV of Md. Golam Robbani_ RUET -IPE
CV of Md. Golam Robbani_ RUET -IPEGolam Robbani
 
Poly dcem2-pediatrie1-t2-2016
Poly   dcem2-pediatrie1-t2-2016Poly   dcem2-pediatrie1-t2-2016
Poly dcem2-pediatrie1-t2-2016
hajoura1971
 
Amy Price CV
Amy Price CVAmy Price CV
Amy Price CVAmy Price
 
Poly dcem2-nephro
Poly   dcem2-nephroPoly   dcem2-nephro
Poly dcem2-nephro
hajoura1971
 
Enc qr m. infectieuses
Enc qr   m. infectieusesEnc qr   m. infectieuses
Enc qr m. infectieuses
hajoura1971
 
Enc qr cardiologie
Enc qr   cardiologieEnc qr   cardiologie
Enc qr cardiologie
hajoura1971
 
موتسارت(Mozart)
موتسارت(Mozart)موتسارت(Mozart)
موتسارت(Mozart)
Youssra Awad
 

Viewers also liked (20)

Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoft
 
Batch processing
Batch processingBatch processing
Batch processing
 
Security components in mule esb
Security components in mule esbSecurity components in mule esb
Security components in mule esb
 
Integration patterns in muleesb
Integration patterns in muleesbIntegration patterns in muleesb
Integration patterns in muleesb
 
Mule architecture styles
Mule architecture stylesMule architecture styles
Mule architecture styles
 
SOLANCA Tennis Academy
SOLANCA Tennis AcademySOLANCA Tennis Academy
SOLANCA Tennis Academy
 
Poly dcem3-ohphtalmo 2016
Poly   dcem3-ohphtalmo 2016Poly   dcem3-ohphtalmo 2016
Poly dcem3-ohphtalmo 2016
 
Poly dcem2-endocrino
Poly   dcem2-endocrinoPoly   dcem2-endocrino
Poly dcem2-endocrino
 
Poly dcem2-chirurgie-2016
Poly   dcem2-chirurgie-2016Poly   dcem2-chirurgie-2016
Poly dcem2-chirurgie-2016
 
CV of Md. Golam Robbani_ RUET -IPE
CV of Md. Golam Robbani_ RUET -IPECV of Md. Golam Robbani_ RUET -IPE
CV of Md. Golam Robbani_ RUET -IPE
 
Poly dcem2-pediatrie1-t2-2016
Poly   dcem2-pediatrie1-t2-2016Poly   dcem2-pediatrie1-t2-2016
Poly dcem2-pediatrie1-t2-2016
 
ConstantinovaAntonina_CV
ConstantinovaAntonina_CVConstantinovaAntonina_CV
ConstantinovaAntonina_CV
 
Amy Price CV
Amy Price CVAmy Price CV
Amy Price CV
 
Poly dcem2-nephro
Poly   dcem2-nephroPoly   dcem2-nephro
Poly dcem2-nephro
 
Enc qr m. infectieuses
Enc qr   m. infectieusesEnc qr   m. infectieuses
Enc qr m. infectieuses
 
TermPaper
TermPaperTermPaper
TermPaper
 
Enc qr cardiologie
Enc qr   cardiologieEnc qr   cardiologie
Enc qr cardiologie
 
موتسارت(Mozart)
موتسارت(Mozart)موتسارت(Mozart)
موتسارت(Mozart)
 

Similar to Anypoint Studio - Mule ESB Error Handling

Error handling
Error handlingError handling
Error handling
krishashi
 
Mule errors
Mule errorsMule errors
Mule errors
Sindhu VL
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
VirtusaPolaris
 
Error handling in mule
Error handling in muleError handling in mule
Error handling in mule
Sindhu VL
 
Error handling with respect to mule
Error handling with respect to muleError handling with respect to mule
Error handling with respect to mule
Sindhu VL
 
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
Swapnil Sahu
 
Mule concepts exception strategies
Mule concepts exception strategiesMule concepts exception strategies
Mule concepts exception strategies
kunal vishe
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
Ramakrishna kapa
 
Exception strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioException strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint Studio
Jitendra Bafna
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
Karthik Selvaraj
 
Mule exceptions Strategy
Mule exceptions StrategyMule exceptions Strategy
Mule exceptions Strategy
Padmanabhan Natarajan, CSM
 
Mule error handling
Mule  error handlingMule  error handling
Mule error handling
chandu1443
 
Mule error handling_choice exception strategy
Mule error handling_choice exception strategyMule error handling_choice exception strategy
Mule error handling_choice exception strategy
kunal vishe
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
Son Nguyen
 
Mule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategyMule exception strategies - Catch exception strategy
Mule exception strategies - Catch exception strategy
Ankush Sharma
 
Mule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception StrategyMule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception Strategy
Ankush Sharma
 
Mule error handling_rollback exception strategy
Mule error handling_rollback exception strategyMule error handling_rollback exception strategy
Mule error handling_rollback exception strategy
kunal vishe
 
Vancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-july
Vikalp Bhalia
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
Thang Loi
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
D.Rajesh Kumar
 

Similar to Anypoint Studio - Mule ESB Error Handling (20)

Error handling
Error handlingError handling
Error handling
 
Mule errors
Mule errorsMule errors
Mule errors
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Error handling in mule
Error handling in muleError handling in mule
Error handling in mule
 
Error handling with respect to mule
Error handling with respect to muleError handling with respect to mule
Error handling with respect to mule
 
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 concepts exception strategies
Mule concepts exception strategiesMule concepts exception strategies
Mule concepts exception strategies
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Exception strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioException strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint Studio
 
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
Mule  error handlingMule  error handling
Mule error handling
 
Mule error handling_choice exception strategy
Mule error handling_choice exception strategyMule error handling_choice exception strategy
Mule error handling_choice exception strategy
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
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_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
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 

Anypoint Studio - Mule ESB Error Handling

  • 1. Manirathnam G Anypoint Studio – Mule ESB Error Handling
  • 2. Index Filter Types Error Handling System Exception Messaging Exception Messaging Exception – Types of Strategies Messaging Exception Strategies - Characteristics Other Ways of Handling Errors
  • 3. Error Handling Introduction  Mule ESB provides numerous options for handling errors. Faults that occur within Mule are referred to as exceptions;  When an activity in Mule instance fails, Mule throws an exception. To manage these exceptions, Mule allows to configure exception strategies.  Mule’s default exception strategy — which implicitly applies to all Mule applications — manages errors (i.e. thrown exceptions) in Mule flows.  When flows require more sophisticated error management, can implement one or more exception strategies to construct precise, efficient protocols for handling errors.  From a high level perspective, errors that occur in Mule fall into one of two categories:  System Exceptions, and  Messaging Exceptions
  • 4. System Exception • 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). For example, system exception strategies handle exceptions that occur: • during application start-up • when a connection to an external system fails • When a system exception strategy occurs, Mule sends an exception notification to registered listeners, logs the exception, and — if the exception was caused by a connection failure — executes the reconnection strategy. System Exception Strategies are not configurable in Mule. Example Scenario: 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. System Exception
  • 5. Messaging Exception • Mule invokes a Messaging Exception Strategy whenever an exception is thrown within a flow (i.e., 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 and processes transfers to the message processor sequence within the exception strategy. We can incorporate any number of message processors – and in one case, other exception strategies – into an exception strategy to handle the exception precisely. Messaging Exception
  • 6. Messaging Exception – Types of Strategies Exception Strategy Use Transaction Error Handling Default exception strategy Defined and implicitly applied by default to handle all messaging exceptions that are thrown in Mule applications When a message throws an exception, the default exception strategy rolls back the message and logs the exception. Catch exception strategy Define a catch exception strategy to customize the way Mule handles any exception. Catch exception strategies consume inbound messages. (Mule’s catch exception strategy behavior is similar to a Java catch block.) When a message throws an exception, the catch exception strategy always commits the transaction and consumes the message. Rollback exception strategy Define a rollback exception strategy to ensure 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. When a message throws an exception, 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.
  • 7. Messaging Exception – Types of Strategies (Contd) Exception Strategy Use Transaction Error Handling Reference exception strategy Define a reference exception strategy to refer and adhere to the error handling parameters defined in a global catch, rollback or choice exception strategy. When a message throws an exception, 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.) Choice exception strategy Define a choice exception strategy to customize the way Mule handles a message that throws an exception based on the message’s content at the moment it throws the exception. When a message throws an exception, 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.)
  • 8. Messaging Exception Strategies - Characteristics Characteristics of messaging exception strategies:  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.)
  • 9. Other Ways of Handling Errors Until Successful Scope  Until Successful behaves similarly to a rollback exception strategy.  This scope attempts to route a message through its child flow until the message is processed successfully. However, we can define the maximum number of processing attempts the Until Successful scope undertakes before it reverts to handling the message as though it were an exception.  We can configure a Failure Expression, an Ack Expression, or a Dead Letter Queue Reference to instruct the scope on how to manage messages that it cannot process. In this respect, Until Successful scope behavior is similar to a rollback exception strategy. Exception Filter  Mule’s Exception filter stops normal flow execution when it discovers a message that contains a message in the “exceptionPayload” field.  By comparison, an exception strategy typically stops normal flow execution when a message throws an exception in the flow. We can combine the two and configure the exception filter to stop normal flow execution and throw an exception, which triggers the exception strategy.
  • 10. Other Ways of Handling Errors (Contd) Reconnection Strategies  Mule’s Reconnection Strategies specify how a connector behaves when its connection fails.  We can control how Mule attempts to reconnect by specifying a number of criteria: the type of exception, the number and frequency of reconnection attempts, the notifications generated, and more.  With a reconnection strategy, can better control the behavior of a failed connection by configuring it, for example, to reattempt the connection only once every 15 minutes, and to stop trying to reconnect after 10 attempts.  Reconnection strategy behavior resembles that of exception strategies, but reconnection strategies provide instructions specifically for — and limited to — reconnection attempts. Eg: <jms:activemq-connector name="AMQConnector"><reconnect count="5" frequency="1000"/></jms:activemq- connector> CXF Error Handling  Web services that utilize CXF can implement Mule exception strategies (such as the Catch and Rollback exception strategies) that are compatible with CXF.