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 (20)

PDF
Mule ESB Fundamentals
Naresh Chintalcheru
 
PDF
Mule ESB - Integration Simplified
Rich Software
 
PDF
Application Architecture: The Next Wave | MuleSoft
MuleSoft
 
PPT
Batch processing
bapiraju
 
ODP
Security components in mule esb
himajareddys
 
ODP
Integration patterns in muleesb
himajareddys
 
ODP
Mule architecture styles
himajareddys
 
DOCX
SOLANCA Tennis Academy
Daniel Camacho
 
PDF
Poly dcem3-ohphtalmo 2016
hajoura1971
 
PDF
Poly dcem2-endocrino
hajoura1971
 
PDF
Poly dcem2-chirurgie-2016
hajoura1971
 
PDF
CV of Md. Golam Robbani_ RUET -IPE
Golam Robbani
 
PDF
Poly dcem2-pediatrie1-t2-2016
hajoura1971
 
DOC
ConstantinovaAntonina_CV
Antonina Constantinova
 
DOCX
Amy Price CV
Amy Price
 
PDF
Poly dcem2-nephro
hajoura1971
 
PDF
Enc qr m. infectieuses
hajoura1971
 
DOCX
TermPaper
Anna Hughes
 
PDF
Enc qr cardiologie
hajoura1971
 
PPTX
موتسارت(Mozart)
Youssra Awad
 
Mule ESB Fundamentals
Naresh Chintalcheru
 
Mule ESB - Integration Simplified
Rich Software
 
Application Architecture: The Next Wave | MuleSoft
MuleSoft
 
Batch processing
bapiraju
 
Security components in mule esb
himajareddys
 
Integration patterns in muleesb
himajareddys
 
Mule architecture styles
himajareddys
 
SOLANCA Tennis Academy
Daniel Camacho
 
Poly dcem3-ohphtalmo 2016
hajoura1971
 
Poly dcem2-endocrino
hajoura1971
 
Poly dcem2-chirurgie-2016
hajoura1971
 
CV of Md. Golam Robbani_ RUET -IPE
Golam Robbani
 
Poly dcem2-pediatrie1-t2-2016
hajoura1971
 
ConstantinovaAntonina_CV
Antonina Constantinova
 
Amy Price CV
Amy Price
 
Poly dcem2-nephro
hajoura1971
 
Enc qr m. infectieuses
hajoura1971
 
TermPaper
Anna Hughes
 
Enc qr cardiologie
hajoura1971
 
موتسارت(Mozart)
Youssra Awad
 

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

PPTX
Error handling
krishashi
 
PPTX
Mule errors
Sindhu VL
 
PPTX
Mule error handling
VirtusaPolaris
 
PPTX
Error handling in mule
Sindhu VL
 
PPTX
Error handling with respect to mule
Sindhu VL
 
PPTX
A short introduction on error handling in anypoint studio
Swapnil Sahu
 
PPTX
Mule concepts exception strategies
kunal vishe
 
PPTX
Mule exception strategies
Ramakrishna kapa
 
PDF
Exception strategies in MuleSoft Anypoint Studio
Jitendra Bafna
 
PPTX
Mule exceptions Strategy
Padmanabhan Natarajan, CSM
 
PPTX
Mule error handling
chandu1443
 
PPTX
Mule error handling_choice exception strategy
kunal vishe
 
PPTX
Handle exceptions in mule
Son Nguyen
 
PPT
Mule exception strategies - Catch exception strategy
Ankush Sharma
 
PPT
Mule exception strategies - Reference Exception Strategy
Ankush Sharma
 
PPTX
Mule error handling_rollback exception strategy
kunal vishe
 
PPTX
Vancouver mulesoft meetup_23-july
Vikalp Bhalia
 
PPTX
Elements in a muleflow
Thang Loi
 
ODP
Mule exception handlingstrategies
D.Rajesh Kumar
 
Error handling
krishashi
 
Mule errors
Sindhu VL
 
Mule error handling
VirtusaPolaris
 
Error handling in mule
Sindhu VL
 
Error handling with respect to mule
Sindhu VL
 
A short introduction on error handling in anypoint studio
Swapnil Sahu
 
Mule concepts exception strategies
kunal vishe
 
Mule exception strategies
Ramakrishna kapa
 
Exception strategies in MuleSoft Anypoint Studio
Jitendra Bafna
 
Mule exceptions Strategy
Padmanabhan Natarajan, CSM
 
Mule error handling
chandu1443
 
Mule error handling_choice exception strategy
kunal vishe
 
Handle exceptions in mule
Son Nguyen
 
Mule exception strategies - Catch exception strategy
Ankush Sharma
 
Mule exception strategies - Reference Exception Strategy
Ankush Sharma
 
Mule error handling_rollback exception strategy
kunal vishe
 
Vancouver mulesoft meetup_23-july
Vikalp Bhalia
 
Elements in a muleflow
Thang Loi
 
Mule exception handlingstrategies
D.Rajesh Kumar
 
Ad

Recently uploaded (20)

PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
community health nursing question paper 2.pdf
Prince kumar
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
Ad

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.