SlideShare a Scribd company logo
[23rd July 2020]
Mule 4 Exception Handling and Munit
[Vancouver-Canada]
All contents © MuleSoft Inc. 2
• Introductions
• Error Handling
• Munit
• Q&A
• What’s next
Agenda
All contents © MuleSoft Inc. 3
Presenters, Organizers and You
Yashwant Palkar
Mule 4 Error Handling
All contents © MuleSoft Inc.
Mule Error Types
Errors that occur in Mule belong to one of following two major categories:
 System Errors
 Mule throws system error when an exception occurs at the system level and no
mule event is involved.
 A system error handlers manages exceptions that occur
 During application startup
 When a connection to an external system fails
 When a system error occurs, Mule sends an error notification to registered
listeners, logs the error, and if the error is caused by a connection failure, executes
a reconnection strategy.
 Messaging Errors
 Mule throws a messaging error (a Mule error) whenever a problem occurs within a
flow of a Mule app, where Mule events and the messages they contain are
processed
 You can handle these messaging error with
 Default Error Handling
 On Error Components
 This is built in error component inside flow.
 You can have any number of components to process error.
All contents © MuleSoft Inc.
Mule Error Hierarchy
 Any: Error type that matches all error types that occur in a Flow and can be handled. This type does not
include errors that occur on the source.
 Transformation: This involves Mule Runtime internal transformations and not DataWeave
transformations.
 Expression: indicate an error occurred while evaluating Dataweave expression
 Validation: indicates validation error occurred
 Duplicate Message: indicates a validation error regarding a message being processed twice
 Connectivity: indicates that there was problem establish a connection
 Routing: indicates an error occurred while routing a message
 Security: indicates a security error occurred, like invalid credentials being received or an expired
token being used.
 Client_Security: indicates an external entity produced an error
 Server_Security: indicates a security error enforced by the Mule Runtime
 Critical: Indicates a severe error occurred. These errors cannot be handled.
 Overload: indicates a problem of overloading occurred and the execution was rejected.
 Fatal_JVM_Error: indicates that fatal error occurred such as overflow
All contents © MuleSoft Inc.
Default Error Handling
 This is laziest way of handling error
 If you don’t handle any error Mule will handle in its own way
 What is Mule way to handle error?
 When a flow is processing a Mule message that raises an error, the normal
execution of the flow stops
 Transfer to default error handler
 Propagates the error
Following example is for default error handling
All contents © MuleSoft Inc.
Creating Error Handlers
 Error handlers can be added to
 Application level – (Global Error Handler)
 A Flow level
 A Processor level(try scope)
All contents © MuleSoft Inc.
Adding Error Handling scopes
 Error handlers can contain one or more error handling scopes
 On Error Propagate
 All processors in this error handling scope are executed
 At end of the scope
 The rest of flow that threw the error is not
executed
 Error is rethrown up to next level and handled
there
 The HTTP listener returns an error response
 On Error Continue
 All processors in this error handling scope are executed
 At end of the scope
 The rest of flow that threw the error is not
executed
 The event is passed to next level as if the flow
execution has completed successfully
 The HTTP listener returns an successful response
All contents © MuleSoft Inc.
Mule 3 vs Mule 4 Error Handling
Mule 3 Mule 4
• Missing error handling at processor level • Using “try” scope processor level error
handling can be achieved
• Error handling is not possible at sub flow
level
• Error handling at subflow level can be done
using “try” scope
• Catch exception strategy can be used to
avoid propagating exception to parent flow
• On error continue process errors and doesn’t
propagates error
• Rollback strategy handles errors that occur
in a flow that involve a transaction
• Transaction are possible using try scope
• Choice exception strategy catches and
evaluates a type or content of exception.
• Error handler with on-error components can
have multiple exception strategy
• Custom errors can be raised with groovy
script or Java code
• Custom error can be raised using Raise
error.
• Custom error mapping is not possible • Custom error mapping of existing exception
is possible and it allows granular error
handling
Demo
MUnit
All contents © MuleSoft Inc.
MUnit is
• Integrated with Anypoint Studio, allowing you to create, design and run MUnit tests just
like you would Mule applications
• It provides a full suite of integration and unit test capabilities
• Integrated with Maven for integration with your continuous deployment
All contents © MuleSoft Inc.
MUnit capabilities
• Create individual test cases by writing Mule Code
• Minimize manual testing
• Mock Processors
• Verify Processors calls
• Spy Processors
• Enable or ignore test cases
• Visual coverage in Studio
• Integrate with CICD
• Generate coverage reports
All contents © MuleSoft Inc.
MUnit Modules
Munit Munit Tools
• Munit is divided in 2 sub modules
• Munit
• MUnit Tools
• Each Module has its own dependency
All contents © MuleSoft Inc.
MUnit Test Scope
• Behavior Scope
• Meant to set all precondition executing the test logic
• Mocks and Spies goes here
• Execution Scope
• Meant to have testing logic that waits for all processes to finish before executing the
next scope
• Run flows in this section
• Validation Scope
• Meant to have all validations regarding result of the execution scope
• Assertions and verifications go here
All contents © MuleSoft Inc.
MUnit Consists
• Set Event
• This message processor is normally used at the beginning of an
MUnit test, to define the first message to send to the flow being
tested
• Mock When
• The Mock When processor allows you to mock an event processor
when it matches the defined name and attributes.
• Spy
• This processor allows you to spy what happens before and after
an event processor is called.
• Assert That
• This event processor allows you to validate the state of Mule
event’s content. This processor uses a set of Dataweave functions
called Munit matchers to define in an expression
Demo
Q&A
All contents © MuleSoft Inc.
Take a stand !
20
• Nominate yourself for
the next meetup speaker
and suggest a topic as
well.
All contents © MuleSoft Inc. 21
• Share:
– Invite your network to join: https://meetups.mulesoft.com/vancouver/
• Feedback:
– Contact your organizers to suggest topics
– Contact MuleSoft at meetup@mulesoft.com for ways to improve the program
– Your feedback is fuel for us
• Our next meetup:
– Date: Aug End/early Sept
– Location: Virtual
– Topic: TBD
What’s next
See you next time
Please send topic suggestions to the organizer
Vancouver mulesoft meetup_23-july

More Related Content

What's hot

MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
Angel Alberici
 
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Angel Alberici
 
Mumbai MuleSoft Meetup 12
Mumbai MuleSoft Meetup 12Mumbai MuleSoft Meetup 12
Mumbai MuleSoft Meetup 12
Akshata Sawant
 
MuleSoft meetup_sg_no2_may19
MuleSoft meetup_sg_no2_may19MuleSoft meetup_sg_no2_may19
MuleSoft meetup_sg_no2_may19
Julian Douch
 
Vancouver mulesoft meetup_september_2020
Vancouver mulesoft meetup_september_2020Vancouver mulesoft meetup_september_2020
Vancouver mulesoft meetup_september_2020
Vikalp Bhalia
 
NYC MuleSoft Meetup 2019 Q1- APIs in action
NYC MuleSoft Meetup 2019 Q1- APIs in actionNYC MuleSoft Meetup 2019 Q1- APIs in action
NYC MuleSoft Meetup 2019 Q1- APIs in action
Gean Martinez
 
MuleSoft Composer - 09122021 - Virtual Muleys
MuleSoft Composer - 09122021 - Virtual Muleys MuleSoft Composer - 09122021 - Virtual Muleys
MuleSoft Composer - 09122021 - Virtual Muleys
Angel Alberici
 
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule #6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
JohnMathewPhilip
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
Nicholas Bowman
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Subhash Patel
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Shekh Muenuddeen
 
Hyderabad meet up-sep12
Hyderabad meet up-sep12Hyderabad meet up-sep12
Hyderabad meet up-sep12
Sravan Lingam
 
MuleSoft Meetup Singapore No.4 December 2019
MuleSoft Meetup Singapore No.4 December 2019MuleSoft Meetup Singapore No.4 December 2019
MuleSoft Meetup Singapore No.4 December 2019
Julian Douch
 
MuleSoft Singapore Meetup - Number 6 - September 24, 2020
MuleSoft Singapore Meetup - Number 6 - September 24, 2020MuleSoft Singapore Meetup - Number 6 - September 24, 2020
MuleSoft Singapore Meetup - Number 6 - September 24, 2020
Julian Douch
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handling
Manish Kumar Yadav
 
MuleSoft_NZ_Meetup_8
MuleSoft_NZ_Meetup_8MuleSoft_NZ_Meetup_8
MuleSoft_NZ_Meetup_8
MizuhoHoshino
 
Meet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalMeet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_final
Akshata Sawant
 
On prem to cloud hub migration (updated)
On prem to cloud hub migration (updated)On prem to cloud hub migration (updated)
On prem to cloud hub migration (updated)
Sandeep Deshmukh
 
Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
Amit Singh
 
Manchester Meetup #3
Manchester Meetup #3Manchester Meetup #3
Manchester Meetup #3
Francis Edwards
 

What's hot (20)

MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
 
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
 
Mumbai MuleSoft Meetup 12
Mumbai MuleSoft Meetup 12Mumbai MuleSoft Meetup 12
Mumbai MuleSoft Meetup 12
 
MuleSoft meetup_sg_no2_may19
MuleSoft meetup_sg_no2_may19MuleSoft meetup_sg_no2_may19
MuleSoft meetup_sg_no2_may19
 
Vancouver mulesoft meetup_september_2020
Vancouver mulesoft meetup_september_2020Vancouver mulesoft meetup_september_2020
Vancouver mulesoft meetup_september_2020
 
NYC MuleSoft Meetup 2019 Q1- APIs in action
NYC MuleSoft Meetup 2019 Q1- APIs in actionNYC MuleSoft Meetup 2019 Q1- APIs in action
NYC MuleSoft Meetup 2019 Q1- APIs in action
 
MuleSoft Composer - 09122021 - Virtual Muleys
MuleSoft Composer - 09122021 - Virtual Muleys MuleSoft Composer - 09122021 - Virtual Muleys
MuleSoft Composer - 09122021 - Virtual Muleys
 
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule #6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
 
Hyderabad meet up-sep12
Hyderabad meet up-sep12Hyderabad meet up-sep12
Hyderabad meet up-sep12
 
MuleSoft Meetup Singapore No.4 December 2019
MuleSoft Meetup Singapore No.4 December 2019MuleSoft Meetup Singapore No.4 December 2019
MuleSoft Meetup Singapore No.4 December 2019
 
MuleSoft Singapore Meetup - Number 6 - September 24, 2020
MuleSoft Singapore Meetup - Number 6 - September 24, 2020MuleSoft Singapore Meetup - Number 6 - September 24, 2020
MuleSoft Singapore Meetup - Number 6 - September 24, 2020
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handling
 
MuleSoft_NZ_Meetup_8
MuleSoft_NZ_Meetup_8MuleSoft_NZ_Meetup_8
MuleSoft_NZ_Meetup_8
 
Meet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalMeet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_final
 
On prem to cloud hub migration (updated)
On prem to cloud hub migration (updated)On prem to cloud hub migration (updated)
On prem to cloud hub migration (updated)
 
Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
 
Manchester Meetup #3
Manchester Meetup #3Manchester Meetup #3
Manchester Meetup #3
 

Similar to Vancouver mulesoft meetup_23-july

Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
Alexandra N. Martinez
 
Mule meetup Hyderabad
Mule meetup HyderabadMule meetup Hyderabad
Mule meetup Hyderabad
Sravan Lingam
 
Mule Meetup Hyderabad - Aug 2020
Mule Meetup Hyderabad - Aug 2020Mule Meetup Hyderabad - Aug 2020
Mule Meetup Hyderabad - Aug 2020
Sravan Lingam
 
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Exception handling in Mule 4 �_Virtual mule soft meetup may_2020Exception handling in Mule 4 �_Virtual mule soft meetup may_2020
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Om Prakash
 
Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020
Om Prakash
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Shekh Muenuddeen
 
MuleSoft Meetup Charlotte 2019 - Dec 10
MuleSoft Meetup Charlotte  2019 - Dec 10MuleSoft Meetup Charlotte  2019 - Dec 10
MuleSoft Meetup Charlotte 2019 - Dec 10
Subhash Patel
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
Amit Singh
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
Subhash Patel
 
MuleSoft Online MeetUp 03_11_2020
MuleSoft Online MeetUp 03_11_2020MuleSoft Online MeetUp 03_11_2020
MuleSoft Online MeetUp 03_11_2020
DianeKesler1
 
Manila MuleSoft Meetup - August 2020
Manila MuleSoft Meetup - August 2020Manila MuleSoft Meetup - August 2020
Manila MuleSoft Meetup - August 2020
Ryan Anthony Andal
 
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
MysoreMuleSoftMeetup
 
Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4
pqrs1234
 
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake IntegrationIndore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
IndoreMulesoftMeetup
 
Mule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error HandlingMule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error Handling
satyasekhar123
 
MuleSoft Meetup Virtual_ 2_Charlotte
MuleSoft Meetup Virtual_ 2_CharlotteMuleSoft Meetup Virtual_ 2_Charlotte
MuleSoft Meetup Virtual_ 2_Charlotte
Subhash Patel
 
Virtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and LoggingVirtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and Logging
Jimmy Attia
 
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
AnoopRamachandran13
 
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
JohnMathewPhilip
 
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoftEngineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Jitendra Bafna
 

Similar to Vancouver mulesoft meetup_23-july (20)

Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
 
Mule meetup Hyderabad
Mule meetup HyderabadMule meetup Hyderabad
Mule meetup Hyderabad
 
Mule Meetup Hyderabad - Aug 2020
Mule Meetup Hyderabad - Aug 2020Mule Meetup Hyderabad - Aug 2020
Mule Meetup Hyderabad - Aug 2020
 
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Exception handling in Mule 4 �_Virtual mule soft meetup may_2020Exception handling in Mule 4 �_Virtual mule soft meetup may_2020
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
 
Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020Virtual MuleSoft Meetup may_2020
Virtual MuleSoft Meetup may_2020
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
 
MuleSoft Meetup Charlotte 2019 - Dec 10
MuleSoft Meetup Charlotte  2019 - Dec 10MuleSoft Meetup Charlotte  2019 - Dec 10
MuleSoft Meetup Charlotte 2019 - Dec 10
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
 
MuleSoft Online MeetUp 03_11_2020
MuleSoft Online MeetUp 03_11_2020MuleSoft Online MeetUp 03_11_2020
MuleSoft Online MeetUp 03_11_2020
 
Manila MuleSoft Meetup - August 2020
Manila MuleSoft Meetup - August 2020Manila MuleSoft Meetup - August 2020
Manila MuleSoft Meetup - August 2020
 
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
Error Handling In Mule 4 | MuleSoft Mysore Meetup #10
 
Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4
 
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake IntegrationIndore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
 
Mule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error HandlingMule soft meetup__dubai_12_june- Error Handling
Mule soft meetup__dubai_12_june- Error Handling
 
MuleSoft Meetup Virtual_ 2_Charlotte
MuleSoft Meetup Virtual_ 2_CharlotteMuleSoft Meetup Virtual_ 2_Charlotte
MuleSoft Meetup Virtual_ 2_Charlotte
 
Virtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and LoggingVirtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and Logging
 
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
 
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
 
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoftEngineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
 

More from Vikalp Bhalia

MuleSoft HyperAutomation
MuleSoft HyperAutomationMuleSoft HyperAutomation
MuleSoft HyperAutomation
Vikalp Bhalia
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
Vikalp Bhalia
 
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdf
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdfThiruvananthapuram Anypoint DataGraph 2 Sept.pdf
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdf
Vikalp Bhalia
 
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdfMuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
Vikalp Bhalia
 
B2B EDI Formats and MuleSoft X12 Connector
B2B EDI Formats and MuleSoft X12 ConnectorB2B EDI Formats and MuleSoft X12 Connector
B2B EDI Formats and MuleSoft X12 Connector
Vikalp Bhalia
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual Event
Vikalp Bhalia
 
Vancouver mulesoft meetup
Vancouver mulesoft meetupVancouver mulesoft meetup
Vancouver mulesoft meetup
Vikalp Bhalia
 

More from Vikalp Bhalia (7)

MuleSoft HyperAutomation
MuleSoft HyperAutomationMuleSoft HyperAutomation
MuleSoft HyperAutomation
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
 
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdf
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdfThiruvananthapuram Anypoint DataGraph 2 Sept.pdf
Thiruvananthapuram Anypoint DataGraph 2 Sept.pdf
 
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdfMuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
MuleSoft_Meetup_Datagraph and Async APIs.pptx.pdf
 
B2B EDI Formats and MuleSoft X12 Connector
B2B EDI Formats and MuleSoft X12 ConnectorB2B EDI Formats and MuleSoft X12 Connector
B2B EDI Formats and MuleSoft X12 Connector
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual Event
 
Vancouver mulesoft meetup
Vancouver mulesoft meetupVancouver mulesoft meetup
Vancouver mulesoft meetup
 

Recently uploaded

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
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
 
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
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
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
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
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
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
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 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
 

Recently uploaded (20)

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
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...
 
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
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
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...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
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
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
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 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
 

Vancouver mulesoft meetup_23-july

  • 1. [23rd July 2020] Mule 4 Exception Handling and Munit [Vancouver-Canada]
  • 2. All contents © MuleSoft Inc. 2 • Introductions • Error Handling • Munit • Q&A • What’s next Agenda
  • 3. All contents © MuleSoft Inc. 3 Presenters, Organizers and You Yashwant Palkar
  • 4. Mule 4 Error Handling
  • 5. All contents © MuleSoft Inc. Mule Error Types Errors that occur in Mule belong to one of following two major categories:  System Errors  Mule throws system error when an exception occurs at the system level and no mule event is involved.  A system error handlers manages exceptions that occur  During application startup  When a connection to an external system fails  When a system error occurs, Mule sends an error notification to registered listeners, logs the error, and if the error is caused by a connection failure, executes a reconnection strategy.  Messaging Errors  Mule throws a messaging error (a Mule error) whenever a problem occurs within a flow of a Mule app, where Mule events and the messages they contain are processed  You can handle these messaging error with  Default Error Handling  On Error Components  This is built in error component inside flow.  You can have any number of components to process error.
  • 6. All contents © MuleSoft Inc. Mule Error Hierarchy  Any: Error type that matches all error types that occur in a Flow and can be handled. This type does not include errors that occur on the source.  Transformation: This involves Mule Runtime internal transformations and not DataWeave transformations.  Expression: indicate an error occurred while evaluating Dataweave expression  Validation: indicates validation error occurred  Duplicate Message: indicates a validation error regarding a message being processed twice  Connectivity: indicates that there was problem establish a connection  Routing: indicates an error occurred while routing a message  Security: indicates a security error occurred, like invalid credentials being received or an expired token being used.  Client_Security: indicates an external entity produced an error  Server_Security: indicates a security error enforced by the Mule Runtime  Critical: Indicates a severe error occurred. These errors cannot be handled.  Overload: indicates a problem of overloading occurred and the execution was rejected.  Fatal_JVM_Error: indicates that fatal error occurred such as overflow
  • 7. All contents © MuleSoft Inc. Default Error Handling  This is laziest way of handling error  If you don’t handle any error Mule will handle in its own way  What is Mule way to handle error?  When a flow is processing a Mule message that raises an error, the normal execution of the flow stops  Transfer to default error handler  Propagates the error Following example is for default error handling
  • 8. All contents © MuleSoft Inc. Creating Error Handlers  Error handlers can be added to  Application level – (Global Error Handler)  A Flow level  A Processor level(try scope)
  • 9. All contents © MuleSoft Inc. Adding Error Handling scopes  Error handlers can contain one or more error handling scopes  On Error Propagate  All processors in this error handling scope are executed  At end of the scope  The rest of flow that threw the error is not executed  Error is rethrown up to next level and handled there  The HTTP listener returns an error response  On Error Continue  All processors in this error handling scope are executed  At end of the scope  The rest of flow that threw the error is not executed  The event is passed to next level as if the flow execution has completed successfully  The HTTP listener returns an successful response
  • 10. All contents © MuleSoft Inc. Mule 3 vs Mule 4 Error Handling Mule 3 Mule 4 • Missing error handling at processor level • Using “try” scope processor level error handling can be achieved • Error handling is not possible at sub flow level • Error handling at subflow level can be done using “try” scope • Catch exception strategy can be used to avoid propagating exception to parent flow • On error continue process errors and doesn’t propagates error • Rollback strategy handles errors that occur in a flow that involve a transaction • Transaction are possible using try scope • Choice exception strategy catches and evaluates a type or content of exception. • Error handler with on-error components can have multiple exception strategy • Custom errors can be raised with groovy script or Java code • Custom error can be raised using Raise error. • Custom error mapping is not possible • Custom error mapping of existing exception is possible and it allows granular error handling
  • 11. Demo
  • 12. MUnit
  • 13. All contents © MuleSoft Inc. MUnit is • Integrated with Anypoint Studio, allowing you to create, design and run MUnit tests just like you would Mule applications • It provides a full suite of integration and unit test capabilities • Integrated with Maven for integration with your continuous deployment
  • 14. All contents © MuleSoft Inc. MUnit capabilities • Create individual test cases by writing Mule Code • Minimize manual testing • Mock Processors • Verify Processors calls • Spy Processors • Enable or ignore test cases • Visual coverage in Studio • Integrate with CICD • Generate coverage reports
  • 15. All contents © MuleSoft Inc. MUnit Modules Munit Munit Tools • Munit is divided in 2 sub modules • Munit • MUnit Tools • Each Module has its own dependency
  • 16. All contents © MuleSoft Inc. MUnit Test Scope • Behavior Scope • Meant to set all precondition executing the test logic • Mocks and Spies goes here • Execution Scope • Meant to have testing logic that waits for all processes to finish before executing the next scope • Run flows in this section • Validation Scope • Meant to have all validations regarding result of the execution scope • Assertions and verifications go here
  • 17. All contents © MuleSoft Inc. MUnit Consists • Set Event • This message processor is normally used at the beginning of an MUnit test, to define the first message to send to the flow being tested • Mock When • The Mock When processor allows you to mock an event processor when it matches the defined name and attributes. • Spy • This processor allows you to spy what happens before and after an event processor is called. • Assert That • This event processor allows you to validate the state of Mule event’s content. This processor uses a set of Dataweave functions called Munit matchers to define in an expression
  • 18. Demo
  • 19. Q&A
  • 20. All contents © MuleSoft Inc. Take a stand ! 20 • Nominate yourself for the next meetup speaker and suggest a topic as well.
  • 21. All contents © MuleSoft Inc. 21 • Share: – Invite your network to join: https://meetups.mulesoft.com/vancouver/ • Feedback: – Contact your organizers to suggest topics – Contact MuleSoft at meetup@mulesoft.com for ways to improve the program – Your feedback is fuel for us • Our next meetup: – Date: Aug End/early Sept – Location: Virtual – Topic: TBD What’s next
  • 22. See you next time Please send topic suggestions to the organizer