SlideShare a Scribd company logo
Error Handling With MuleSoft
Surat MuleSoft Meetup Group
Sept 2, 2022
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
2
A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & AnswersTab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of theday.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
3
Organizers
4
Jitendra Bafna
Senior Solution Architect
EPAM Systems
Nitish Jain
Application Developer
Accenture
Speaker
Nikhil Kunkulol
Lead Engineer, Apisero Inc.
About the Speaker:
● Working as Senior Lead Engineer at Apisero Inc.
● 4+ year of Total Experience. 3+ years in MuleSoft.
● Certified MuleSoft Developer and Integration Architect.
● Kolhapur Meetup Leader
6
Contents:
●Error Types
●Error Components
●Try-Catch Scope
●Error Handling in Private Flow vs Sub flow
●Raise Custom Errors
●Error Handling in Parallel- For-Each/For-Each
●Error Handling in Batch-Processing, Scatter Gather
●Error Handling in Dataweave
Error Handling
There are 2 types of Errors:
● System errors
● Messaging errors
* Error Object is created when a Messaging Error occurs. In order to do this, we have to
understand what an Error Object in Mule 4 is.
7
Selector Expressions for Mule Errors
8
Error Hierarchy
9
Components
10
On Error-Continue vs Propagate
11
Configuring Global-Error Handler
12
Custom-Error Handling
13
Try scope
14
Try Scope: On Error Continue
15
Try Scope: On Error Propagate
16
Child Flow Error-Handling
17
Behaviour - For-Each ,Parallel-For-Each
18
Error Handling - For-Each ,Parallel - For-Each
19
Error Handling-Scatter Gather
When to use Scatter Gather :
● Scatter-Gather is best suited for Multicast scenarios.
● The Scatter-Gather messages are processed in-parallel with aggregate responses.
● More than one process is required for Scatter-Gather to function according to its discussed
merits.
● The MuleSoft Scatter-Gather has many features to control the execution flow in case of route
failures.
20
Error Handling-Scatter Gather
Points to remember:
● What happens to the initial payload, when one of the processes in the Scatter-Gather
fails?
● What happens if the variable in one process is modified and not in the other?
● What would be the result of Scatter-Gather if “On-Error propagates” is used instead of
“On-Error continue” when one of the routes fails?
21
Case - 1
22
Case - 2
23
Error handling Batch processing
Points to remember in batch process error handling:
● Any error occur inside batch job will never propagate to Main flow error
handler. But if error occurs in the source section then it will come to Main Flow
error handler
● maxFailedRecords – 0 – Stop processing when a failed record is found.
maxFailedRecords – 1 – Continue processing indefinitely, regardless of the
number of failed records.
maxFailedRecords – integer – Continue processing until reaching maximum
number of failed records.
24
Error handling Batch processing
There are 2 ways you can handle errors in batch processing
● Add a batch step with accept policy as “ONLY_FAILURES” to know all those
records which have failed in earlier batch steps.
● Add try catch activity in Batch Steps
25
Batch Processing Case-1
26
Batch Processing Case-2
27
Error Handling in Dataweave
● fail()
● failIf()
● Try()
● orElse()
● orElseTry()
28
Q & A
Take a stand !
18
●Nominate yourself for the next meetup speaker and suggest a topic as well.
20
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/engineering-student-
group/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?
20
● 21st May 2022 - Understanding the Anypoint Flex Gateway
● 11th June 2022 - Implementing and Understanding SAGA (Orchestration and
Choreography) Patterns With MuleSoft
● 24th June 2022 - Combine Service Mesh With Anypoint API Management to
power Microservices
● 30th June 2022 - Understanding EKS/RTF Architecture and Components
● 9th July 2022 - Driving Digital Transformation in Banking Industries With
MuleSoft
Upcoming Meetups
Quiz Time
Get ready to WIN a Special Gift from MuleSoft Community
Thank you

More Related Content

PDF
MuleSoft Composer | Patna MuleSoft Meetup #14
PDF
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
PPTX
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
PPTX
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
PPTX
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
PPTX
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
PPTX
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
PPTX
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
MuleSoft Composer | Patna MuleSoft Meetup #14
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx

Similar to MuleSoft Surat Meetup#47 - Error Handling With MuleSoft (20)

PPTX
MuleSoft HyperAutomation
PPTX
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
PPTX
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
PPTX
Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...
PDF
MuleSoft Surat Meetup#46 - Deep Dive into MUnit With MuleSoft
PPTX
Delhi MuleSoft Meetup - 19 march2022
PPTX
Denver MuleSoft Meetup Feb 24, 2021 - What's Batch Got to Do with It
PPTX
Coimbatore Second Mule Meetup on Error Handling in Mule 4
PDF
MuleSoft Surat Virtual Meetup#29 - Deep Dive into MuleSoft Batch Processing (...
PDF
Denver MuleSoft Meetup: Greatest MuleSoft Hits of 2022
PPTX
MuleSoft Composer for Salesforce.pptx
PPTX
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
PDF
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
PPTX
Virtual MuleSoft Meetup may_2020
PPTX
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
PPTX
Online Spanish meetup #1
PPTX
Mulesoft meetup slides mumbai_20113019_exception_handling
PPTX
Mule soft meetup__adelaide_october_2020_final (2)
PPTX
Coimbatore meetup error handling 24apr2021
PPTX
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
MuleSoft HyperAutomation
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...
MuleSoft Surat Meetup#46 - Deep Dive into MUnit With MuleSoft
Delhi MuleSoft Meetup - 19 march2022
Denver MuleSoft Meetup Feb 24, 2021 - What's Batch Got to Do with It
Coimbatore Second Mule Meetup on Error Handling in Mule 4
MuleSoft Surat Virtual Meetup#29 - Deep Dive into MuleSoft Batch Processing (...
Denver MuleSoft Meetup: Greatest MuleSoft Hits of 2022
MuleSoft Composer for Salesforce.pptx
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
Virtual MuleSoft Meetup may_2020
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Online Spanish meetup #1
Mulesoft meetup slides mumbai_20113019_exception_handling
Mule soft meetup__adelaide_october_2020_final (2)
Coimbatore meetup error handling 24apr2021
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Ad

More from Jitendra Bafna (20)

PDF
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
PDF
MuleSoft Surat Meetup#54 - MuleSoft Automation
PDF
MuleSoft Surat Meetup#53 - MuleSoft for Clinical Trial Modernization
PDF
MuleSoft Surat Meetup#52 - Flex Gateway (Port Based Routing V/S Path Based Ro...
PDF
MuleSoft Surat Meetup#51 - API Monitoring - Through a New Lens
PDF
Engineering Student MuleSoft Meetup#7 - Leveraging MuleSoft Service in Salesf...
PDF
MuleSoft Nashik Meetup#7 - Building FHIR applications in MongoDB using MuleSoft
PDF
MuleSoft Surat Meetup#50 - Ask the MuleSoft Ambassadors + CloudHub 2.0 Overvi...
PDF
MuleSoft Surat Meetup#49 - Robotic Process Automation - Why, Where, When and ...
PDF
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
PDF
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
PDF
MuleSoft Surat Meetup#44 - Anypoint Flex Gateway Custom Policies With Rust
PDF
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
PDF
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
PDF
MuleSoft Surat Meetup#43 - Combine Service Mesh With Anypoint API Management ...
PDF
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
PDF
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
PDF
Engineering Student MuleSoft Meetup#4 - API Testing With MuleSoft
PDF
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
PDF
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
MuleSoft Surat Meetup#54 - MuleSoft Automation
MuleSoft Surat Meetup#53 - MuleSoft for Clinical Trial Modernization
MuleSoft Surat Meetup#52 - Flex Gateway (Port Based Routing V/S Path Based Ro...
MuleSoft Surat Meetup#51 - API Monitoring - Through a New Lens
Engineering Student MuleSoft Meetup#7 - Leveraging MuleSoft Service in Salesf...
MuleSoft Nashik Meetup#7 - Building FHIR applications in MongoDB using MuleSoft
MuleSoft Surat Meetup#50 - Ask the MuleSoft Ambassadors + CloudHub 2.0 Overvi...
MuleSoft Surat Meetup#49 - Robotic Process Automation - Why, Where, When and ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
MuleSoft Surat Meetup#44 - Anypoint Flex Gateway Custom Policies With Rust
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
MuleSoft Surat Meetup#43 - Combine Service Mesh With Anypoint API Management ...
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
Engineering Student MuleSoft Meetup#4 - API Testing With MuleSoft
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The AUB Centre for AI in Media Proposal.docx
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

MuleSoft Surat Meetup#47 - Error Handling With MuleSoft

  • 1. Error Handling With MuleSoft Surat MuleSoft Meetup Group Sept 2, 2022
  • 2. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 2
  • 3. A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & AnswersTab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of theday. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 3
  • 4. Organizers 4 Jitendra Bafna Senior Solution Architect EPAM Systems Nitish Jain Application Developer Accenture
  • 5. Speaker Nikhil Kunkulol Lead Engineer, Apisero Inc. About the Speaker: ● Working as Senior Lead Engineer at Apisero Inc. ● 4+ year of Total Experience. 3+ years in MuleSoft. ● Certified MuleSoft Developer and Integration Architect. ● Kolhapur Meetup Leader
  • 6. 6 Contents: ●Error Types ●Error Components ●Try-Catch Scope ●Error Handling in Private Flow vs Sub flow ●Raise Custom Errors ●Error Handling in Parallel- For-Each/For-Each ●Error Handling in Batch-Processing, Scatter Gather ●Error Handling in Dataweave Error Handling
  • 7. There are 2 types of Errors: ● System errors ● Messaging errors * Error Object is created when a Messaging Error occurs. In order to do this, we have to understand what an Error Object in Mule 4 is. 7
  • 8. Selector Expressions for Mule Errors 8
  • 11. On Error-Continue vs Propagate 11
  • 15. Try Scope: On Error Continue 15
  • 16. Try Scope: On Error Propagate 16
  • 18. Behaviour - For-Each ,Parallel-For-Each 18
  • 19. Error Handling - For-Each ,Parallel - For-Each 19
  • 20. Error Handling-Scatter Gather When to use Scatter Gather : ● Scatter-Gather is best suited for Multicast scenarios. ● The Scatter-Gather messages are processed in-parallel with aggregate responses. ● More than one process is required for Scatter-Gather to function according to its discussed merits. ● The MuleSoft Scatter-Gather has many features to control the execution flow in case of route failures. 20
  • 21. Error Handling-Scatter Gather Points to remember: ● What happens to the initial payload, when one of the processes in the Scatter-Gather fails? ● What happens if the variable in one process is modified and not in the other? ● What would be the result of Scatter-Gather if “On-Error propagates” is used instead of “On-Error continue” when one of the routes fails? 21
  • 24. Error handling Batch processing Points to remember in batch process error handling: ● Any error occur inside batch job will never propagate to Main flow error handler. But if error occurs in the source section then it will come to Main Flow error handler ● maxFailedRecords – 0 – Stop processing when a failed record is found. maxFailedRecords – 1 – Continue processing indefinitely, regardless of the number of failed records. maxFailedRecords – integer – Continue processing until reaching maximum number of failed records. 24
  • 25. Error handling Batch processing There are 2 ways you can handle errors in batch processing ● Add a batch step with accept policy as “ONLY_FAILURES” to know all those records which have failed in earlier batch steps. ● Add try catch activity in Batch Steps 25
  • 28. Error Handling in Dataweave ● fail() ● failIf() ● Try() ● orElse() ● orElseTry() 28
  • 29. Q & A
  • 30. Take a stand ! 18 ●Nominate yourself for the next meetup speaker and suggest a topic as well.
  • 31. 20 ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Invite your network to join: https://meetups.mulesoft.com/engineering-student- group/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program What’s next?
  • 32. 20 ● 21st May 2022 - Understanding the Anypoint Flex Gateway ● 11th June 2022 - Implementing and Understanding SAGA (Orchestration and Choreography) Patterns With MuleSoft ● 24th June 2022 - Combine Service Mesh With Anypoint API Management to power Microservices ● 30th June 2022 - Understanding EKS/RTF Architecture and Components ● 9th July 2022 - Driving Digital Transformation in Banking Industries With MuleSoft Upcoming Meetups
  • 33. Quiz Time Get ready to WIN a Special Gift from MuleSoft Community