SlideShare a Scribd company logo
1 of 9
Mule Concepts
Error Handling
Choice Exception Strategy
• Choice exception strategy can be defined to customize the
way Mule handles a message with an error based on the
message’s content at the moment it throws an exception.
• A choice exception strategy :
– catches all exceptions thrown within its parent flow
– examines message contents and exception type
– then routes messages to the appropriate exception strategy for
processing.
• Usually more than once exception strategy is defined within
the choice exception strategy.
• Each exception strategy – either catch or rollback – uses
a Mule expression to advise the choice exception strategy
which type of messages it accepts and processes.
Choice Exception Strategy
• How it works :
– when the choice exception strategy catches an exception:
• It evaluates the type of exception and the message contents at the
time the error occurred.
• Then it checks the expression attribute of each of its exception
strategies one by one, serially, to see which one of them should
handle the error.
• It then routes the message to the firstexception strategy that
evaluates to true (has an expression that matches the expression
of the message).
• If none of its exception strategies can handle the error, the choice
exception strategy routes the message to Mule’s default exception
strategy.
Choice Exception Strategy
• How it works :
– when the choice exception strategy catches an exception:
• It evaluates the type of exception and the message contents at the
time the error occurred.
• Then it checks the expression attribute of each of its exception
strategies one by one, serially, to see which one of them should
handle the error.
• It then routes the message to the firstexception strategy that
evaluates to true (has an expression that matches the expression
of the message).
• If none of its exception strategies can handle the error, the choice
exception strategy routes the message to Mule’s default exception
strategy.
Choice Exception Strategy
• You can put any number of catch or rollback
exception strategies into a choice exception strategy.
• You cannot put a choice exception strategy inside
another choice exception strategy.
• You can use any Mule expression evaluator as the
expression attribute of an exception strategy.
Choice Exception Strategy
• When to Use :
– Use a choice exception strategy to enable Mule to make
decisions about how to handle each error that occurs in a
flow.
– For example, in a flow that processes orders, a choice
exception strategy can be used to apply the following error
handling rules:
• Messages that throw an AlreadyProcessedException should be
discarded.
• Messages that throw a ValidationException should be sent to an
invalid order queue.
• All other messages which throw exceptions should be rolled back
to retry processing.
Choice Exception Strategy
– A choice exception strategy can evaluate the exception
type of each message that throws an exception in this flow
and route them to one of three exception strategies:
• a catch exception strategy to process and discard all
AlreadyProcessedExceptions.
• a second catch exception strategy to process all
ValidationExceptions and send them to an invalid.orders queue
• a rollback exception strategy to roll back the order transaction in
order to retry processing in the parent flow
Choice Exception Strategy
– The following lists some useful expressions which check for
specific exceptions:
• #[exception.causedBy(ExceptionType)]
– Checks that the exception is an instance of ExceptionType
– Example : #[exception.causedBy(java.lang.IllegalArgumentException)]
• #[exception.causedExactlyBy(ExceptionType)]
– Checks that the exception exactly matches the ExceptionType
– Example : #[exception.causedExactlyBy(java.net.SocketTimeoutException)]
• #[exception.causeMatches(String)]
– Checks that the exception type matches a particular regular expression
(Regex) String
– Example : #[exception.causeMatches('*BusinessException')]
Choice Exception Strategy
– Configuration:
• From the Error Handling palette group, drag and drop the choice
exception strategy icon into the footer bar of a flow.
• Click the title bar of the exception strategy to open its Properties Editor,
then enter a name for your choice exception strategy in the Display
Name field.
• From the Error Handling palette group, drag and drop one or more catch
or rollback exception strategy icons into the choice exception strategy box.
– Note :
• choice exception strategy checks the expression attribute of each of its
exception strategies one by one, serially, to see which one of them should
handle the error.
• It then routes the message to the first exception strategy that evaluates to
true.
• Therefore, organize your exception strategies keeping in mind that the
top-most will be evaluated first, then the one below it, and so on.
• You cannot rearrange the exception strategies once they have been
placed inside the choice exception strategy, but can use xml for
rearranging the strategies.
Choice Exception Strategy

More Related Content

What's hot

Anypoint Studio - Mule ESB Error Handling
Anypoint Studio - Mule ESB Error HandlingAnypoint Studio - Mule ESB Error Handling
Anypoint Studio - Mule ESB Error HandlingMani Rathnam Gudi
 
Mule error handling
Mule error handlingMule error handling
Mule error handlingVirtusaPolaris
 
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
 

What's hot (6)

Anypoint Studio - Mule ESB Error Handling
Anypoint Studio - Mule ESB Error HandlingAnypoint Studio - Mule ESB Error Handling
Anypoint Studio - Mule ESB Error Handling
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Mule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception StrategyMule exception strategies - Reference Exception Strategy
Mule exception strategies - Reference Exception Strategy
 
Exception handling in mule
Exception handling in muleException handling in mule
Exception handling in mule
 
Mule exceptions Strategy
Mule exceptions StrategyMule exceptions Strategy
Mule exceptions Strategy
 
Matlab decisions
Matlab decisionsMatlab decisions
Matlab decisions
 

Viewers also liked

Mule mel 4_tips
Mule mel 4_tipsMule mel 4_tips
Mule mel 4_tipskunal vishe
 
Mule soft exception
Mule soft exceptionMule soft exception
Mule soft exceptionSon Nguyen
 
Mule with spring security manager
Mule with spring security managerMule with spring security manager
Mule with spring security managerSon Nguyen
 
Mule for each scope header collection
Mule for each scope   header collectionMule for each scope   header collection
Mule for each scope header collectionRam Bavireddi
 
Mule and web services
Mule and web servicesMule and web services
Mule and web servicesPrabhat gangwar
 
Beyond a LMS
Beyond a LMSBeyond a LMS
Beyond a LMSEcosAgile
 
Domain driven design com functional programing(f#)
Domain driven design com functional programing(f#)Domain driven design com functional programing(f#)
Domain driven design com functional programing(f#)Rafael Salerno de Oliveira
 
Django Templates
Django TemplatesDjango Templates
Django TemplatesWilly Liu
 
Mule scopes 1
Mule scopes 1Mule scopes 1
Mule scopes 1kunal vishe
 
Mule scopes 2
Mule scopes 2Mule scopes 2
Mule scopes 2kunal vishe
 
Higher Education CRM Presentation
Higher Education CRM PresentationHigher Education CRM Presentation
Higher Education CRM PresentationMike Reardon
 
Mule error handling_rollback exception strategy
Mule error handling_rollback exception strategyMule error handling_rollback exception strategy
Mule error handling_rollback exception strategykunal vishe
 
Mule message
Mule messageMule message
Mule messagekunal vishe
 
Input and output flow using file and logger component
Input and output flow using file and logger component Input and output flow using file and logger component
Input and output flow using file and logger component Son Nguyen
 
Jenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup SlidesJenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup SlidesGergely Brautigam
 
Introduction into Procedural Content Generation by Yogie Aditya
Introduction into Procedural Content Generation by Yogie AdityaIntroduction into Procedural Content Generation by Yogie Aditya
Introduction into Procedural Content Generation by Yogie AdityagamelanYK
 
Mule data weave_6
Mule data weave_6Mule data weave_6
Mule data weave_6kunal vishe
 
Trans xml into_another_xml
Trans xml into_another_xmlTrans xml into_another_xml
Trans xml into_another_xmlSwati Deshpande
 

Viewers also liked (20)

Mule mel 4_tips
Mule mel 4_tipsMule mel 4_tips
Mule mel 4_tips
 
Mule soft exception
Mule soft exceptionMule soft exception
Mule soft exception
 
Mule with spring security manager
Mule with spring security managerMule with spring security manager
Mule with spring security manager
 
Mule for each scope header collection
Mule for each scope   header collectionMule for each scope   header collection
Mule for each scope header collection
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Beyond a LMS
Beyond a LMSBeyond a LMS
Beyond a LMS
 
Domain driven design com functional programing(f#)
Domain driven design com functional programing(f#)Domain driven design com functional programing(f#)
Domain driven design com functional programing(f#)
 
Django Templates
Django TemplatesDjango Templates
Django Templates
 
How to Design A Game
How to Design A GameHow to Design A Game
How to Design A Game
 
Mule scopes 1
Mule scopes 1Mule scopes 1
Mule scopes 1
 
Mule scopes 2
Mule scopes 2Mule scopes 2
Mule scopes 2
 
Higher Education CRM Presentation
Higher Education CRM PresentationHigher Education CRM Presentation
Higher Education CRM Presentation
 
Mule error handling_rollback exception strategy
Mule error handling_rollback exception strategyMule error handling_rollback exception strategy
Mule error handling_rollback exception strategy
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Mule message
Mule messageMule message
Mule message
 
Input and output flow using file and logger component
Input and output flow using file and logger component Input and output flow using file and logger component
Input and output flow using file and logger component
 
Jenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup SlidesJenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup Slides
 
Introduction into Procedural Content Generation by Yogie Aditya
Introduction into Procedural Content Generation by Yogie AdityaIntroduction into Procedural Content Generation by Yogie Aditya
Introduction into Procedural Content Generation by Yogie Aditya
 
Mule data weave_6
Mule data weave_6Mule data weave_6
Mule data weave_6
 
Trans xml into_another_xml
Trans xml into_another_xmlTrans xml into_another_xml
Trans xml into_another_xml
 

Similar to Mule error handling_choice exception strategy

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 exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategiesRamakrishna kapa
 
Error handling
Error handlingError handling
Error handlingkrishashi
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in muleSon Nguyen
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategiesKrishna_in
 
Exception strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioException strategies in MuleSoft Anypoint Studio
Exception strategies in MuleSoft Anypoint StudioJitendra Bafna
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaAdil Mehmoood
 
Exception handling
Exception handlingException handling
Exception handlingpooja kumari
 
Java Exceptions and Exception Handling
 Java  Exceptions and Exception Handling Java  Exceptions and Exception Handling
Java Exceptions and Exception HandlingMaqdamYasir
 
Mule error handling
Mule  error handlingMule  error handling
Mule error handlingchandu1443
 
Understanding Mahout classification documentation
Understanding Mahout  classification documentationUnderstanding Mahout  classification documentation
Understanding Mahout classification documentationNaveen Kumar
 
Tester contribution to Testing Effectiveness. An Empirical Research
Tester contribution to Testing Effectiveness. An Empirical ResearchTester contribution to Testing Effectiveness. An Empirical Research
Tester contribution to Testing Effectiveness. An Empirical ResearchNatalia Juristo
 
Exception handling chapter15
Exception handling chapter15Exception handling chapter15
Exception handling chapter15Kumar
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examplesMani Deepak Choudhry
 
Exception Handling in UiPath.pptx
Exception Handling in UiPath.pptxException Handling in UiPath.pptx
Exception Handling in UiPath.pptxApurbaSamanta9
 
Initializing & Optimizing Machine Learning Models
Initializing & Optimizing Machine Learning ModelsInitializing & Optimizing Machine Learning Models
Initializing & Optimizing Machine Learning ModelsEng Teong Cheah
 
Simulation.pps.pdf
Simulation.pps.pdfSimulation.pps.pdf
Simulation.pps.pdfAmanSaini399586
 
Feature selection
Feature selectionFeature selection
Feature selectiondkpawar
 
Exception handling in java.pptx
Exception handling in java.pptxException handling in java.pptx
Exception handling in java.pptxARUNPRANESHS
 

Similar to Mule error handling_choice exception strategy (20)

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 exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Error handling
Error handlingError handling
Error handling
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
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
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exception handling
Exception handlingException handling
Exception handling
 
Java Exceptions and Exception Handling
 Java  Exceptions and Exception Handling Java  Exceptions and Exception Handling
Java Exceptions and Exception Handling
 
Mule error handling
Mule  error handlingMule  error handling
Mule error handling
 
Understanding Mahout classification documentation
Understanding Mahout  classification documentationUnderstanding Mahout  classification documentation
Understanding Mahout classification documentation
 
Tester contribution to Testing Effectiveness. An Empirical Research
Tester contribution to Testing Effectiveness. An Empirical ResearchTester contribution to Testing Effectiveness. An Empirical Research
Tester contribution to Testing Effectiveness. An Empirical Research
 
Exception handling chapter15
Exception handling chapter15Exception handling chapter15
Exception handling chapter15
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examples
 
Exception Handling in UiPath.pptx
Exception Handling in UiPath.pptxException Handling in UiPath.pptx
Exception Handling in UiPath.pptx
 
Initializing & Optimizing Machine Learning Models
Initializing & Optimizing Machine Learning ModelsInitializing & Optimizing Machine Learning Models
Initializing & Optimizing Machine Learning Models
 
Simulation.pps.pdf
Simulation.pps.pdfSimulation.pps.pdf
Simulation.pps.pdf
 
Feature selection
Feature selectionFeature selection
Feature selection
 
Exception handling in java.pptx
Exception handling in java.pptxException handling in java.pptx
Exception handling in java.pptx
 

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_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 mel 5_tips
Mule mel 5_tipsMule mel 5_tips
Mule mel 5_tipskunal vishe
 
Mule mel 3
Mule mel 3Mule mel 3
Mule mel 3kunal vishe
 
Mule mel 2
Mule mel 2Mule mel 2
Mule mel 2kunal vishe
 
Mule mel 1
Mule mel 1Mule mel 1
Mule mel 1kunal 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
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traceskunal vishe
 
Mule concepts filters scopes_routers
Mule concepts filters scopes_routersMule concepts filters scopes_routers
Mule concepts filters scopes_routerskunal vishe
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformerskunal vishe
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts componentskunal 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_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 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 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
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
 
Mule concepts filters scopes_routers
Mule concepts filters scopes_routersMule concepts filters scopes_routers
Mule concepts filters scopes_routers
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts components
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Mule error handling_choice exception strategy

  • 2. • Choice exception strategy can be defined to customize the way Mule handles a message with an error based on the message’s content at the moment it throws an exception. • A choice exception strategy : – catches all exceptions thrown within its parent flow – examines message contents and exception type – then routes messages to the appropriate exception strategy for processing. • Usually more than once exception strategy is defined within the choice exception strategy. • Each exception strategy – either catch or rollback – uses a Mule expression to advise the choice exception strategy which type of messages it accepts and processes. Choice Exception Strategy
  • 3. • How it works : – when the choice exception strategy catches an exception: • It evaluates the type of exception and the message contents at the time the error occurred. • Then it checks the expression attribute of each of its exception strategies one by one, serially, to see which one of them should handle the error. • It then routes the message to the firstexception strategy that evaluates to true (has an expression that matches the expression of the message). • If none of its exception strategies can handle the error, the choice exception strategy routes the message to Mule’s default exception strategy. Choice Exception Strategy
  • 4. • How it works : – when the choice exception strategy catches an exception: • It evaluates the type of exception and the message contents at the time the error occurred. • Then it checks the expression attribute of each of its exception strategies one by one, serially, to see which one of them should handle the error. • It then routes the message to the firstexception strategy that evaluates to true (has an expression that matches the expression of the message). • If none of its exception strategies can handle the error, the choice exception strategy routes the message to Mule’s default exception strategy. Choice Exception Strategy
  • 5. • You can put any number of catch or rollback exception strategies into a choice exception strategy. • You cannot put a choice exception strategy inside another choice exception strategy. • You can use any Mule expression evaluator as the expression attribute of an exception strategy. Choice Exception Strategy
  • 6. • When to Use : – Use a choice exception strategy to enable Mule to make decisions about how to handle each error that occurs in a flow. – For example, in a flow that processes orders, a choice exception strategy can be used to apply the following error handling rules: • Messages that throw an AlreadyProcessedException should be discarded. • Messages that throw a ValidationException should be sent to an invalid order queue. • All other messages which throw exceptions should be rolled back to retry processing. Choice Exception Strategy
  • 7. – A choice exception strategy can evaluate the exception type of each message that throws an exception in this flow and route them to one of three exception strategies: • a catch exception strategy to process and discard all AlreadyProcessedExceptions. • a second catch exception strategy to process all ValidationExceptions and send them to an invalid.orders queue • a rollback exception strategy to roll back the order transaction in order to retry processing in the parent flow Choice Exception Strategy
  • 8. – The following lists some useful expressions which check for specific exceptions: • #[exception.causedBy(ExceptionType)] – Checks that the exception is an instance of ExceptionType – Example : #[exception.causedBy(java.lang.IllegalArgumentException)] • #[exception.causedExactlyBy(ExceptionType)] – Checks that the exception exactly matches the ExceptionType – Example : #[exception.causedExactlyBy(java.net.SocketTimeoutException)] • #[exception.causeMatches(String)] – Checks that the exception type matches a particular regular expression (Regex) String – Example : #[exception.causeMatches('*BusinessException')] Choice Exception Strategy
  • 9. – Configuration: • From the Error Handling palette group, drag and drop the choice exception strategy icon into the footer bar of a flow. • Click the title bar of the exception strategy to open its Properties Editor, then enter a name for your choice exception strategy in the Display Name field. • From the Error Handling palette group, drag and drop one or more catch or rollback exception strategy icons into the choice exception strategy box. – Note : • choice exception strategy checks the expression attribute of each of its exception strategies one by one, serially, to see which one of them should handle the error. • It then routes the message to the first exception strategy that evaluates to true. • Therefore, organize your exception strategies keeping in mind that the top-most will be evaluated first, then the one below it, and so on. • You cannot rearrange the exception strategies once they have been placed inside the choice exception strategy, but can use xml for rearranging the strategies. Choice Exception Strategy