SlideShare a Scribd company logo
Reference Exception Strategy
Abstract
• The main motto of this PPT is How to use
Reference Exception Strategy in our
applications.
Introduction
• You can create one or more global exception
strategies to reuse in flows throughout your
entire Mule application. First, create a global
exception strategy, then add a Reference
Exception Strategy to a flow to apply the error
handling behavior of a specific global
exception strategy.
Example
.mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
• xmlns:spring="http://www.springframework.org/schema/beans"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
• http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
• <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8087" doc:name="HTTP
Listener Configuration"/>
• <flow name="JsonSchemaValidatorFlow">
• <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
• <json:validate-schema schemaLocation="Schema.json" doc:name="Validate JSON Schema"/>
• <logger message="--Valid input" level="INFO" doc:name="Logger"/>
• <exception-strategy ref="JsonSchemaValidatorCatch_Exception_Strategy" doc:name="Reference Exception
Strategy"/>
• </flow>
• <catch-exception-strategy name="JsonSchemaValidatorCatch_Exception_Strategy">
• <set-property propertyName="http.status" value="400" doc:name="Property"/>
• <set-payload value="Invalid input request" doc:name="Set Payload"/>
• </catch-exception-strategy>
• </mule>
• Place the schema file in src/main/resources
• Output:
• If the input is valid input:
• INFO 2016-12-22 09:23:32,157
[[JsonSchemaValidator].HTTP_Listener_Config
uration.worker.02]
org.mule.api.processor.LoggerMessageProcess
or: --Valid input
• If the input is invalid input:
• ERROR 2016-12-22 09:23:15,139 [[JsonSchemaValidator].HTTP_Listener_Configuration.worker.02] org.mule.exception.DefaultMessagingExceptionStrategy:
• ********************************************************************************
• Message : Json content is not compliant with schema
• com.github.fge.jsonschema.core.report.ListProcessingReport: failure
• --- BEGIN MESSAGES ---
• error: object has missing required properties (["firstName"])
• level: "error"
• schema: {"loadingURI":"file:/C:/Users/sivachandra.mandalap/AnypointStudio/workspace1/.mule/apps/JsonSchemaValidator/classes/Schema.json#","pointer":""}
• instance: {"pointer":""}
• domain: "validation"
• keyword: "required"
• required: ["firstName","lastName"]
• missing: ["firstName"]
• --- END MESSAGES ---
• Payload : {"lastName":"def","age":10}
• Payload Type : java.lang.String
• Element : /JsonSchemaValidatorFlow/processors/0 @ JsonSchemaValidator
• --------------------------------------------------------------------------------
• Root Exception stack trace:
• org.mule.module.json.validation.JsonSchemaValidationException: Json content is not compliant with schema
• com.github.fge.jsonschema.core.report.ListProcessingReport: failure
• --- BEGIN MESSAGES ---
• error: object has missing required properties (["firstName"])
• level: "error"
• schema: {"loadingURI":"file:/C:/Users/sivachandra.mandalap/AnypointStudio/workspace1/.mule/apps/JsonSchemaValidator/classes/Schema.json#","pointer":""}
• instance: {"pointer":""}
• domain: "validation"
• keyword: "required"
• required: ["firstName","lastName"]
• missing: ["firstName"]
• --- END MESSAGES ---
• at org.mule.module.json.validation.JsonSchemaValidator.validate(JsonSchemaValidator.java:286)
• at org.mule.module.json.validation.ValidateJsonSchemaMessageProcessor.process(ValidateJsonSchemaMessageProcessor.java:46)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• Flow of execution:
1. URL to trigger the service from browser
Valid Request:
• Invalid Request:
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/reference-exception-strategy

More Related Content

What's hot (12)

PPTX
Expression filter in Mule
Mohammed246
 
PPTX
How to use expression filter
Praneethchampion
 
PPTX
Data Mapper
sivachandra mandalapu
 
PPTX
How to use splitter component
RaviRajuRamaKrishna
 
PPTX
Filter expression in mule
Rajkattamuri
 
PPTX
Quartz component in mule
javeed_mhd
 
PPTX
Basic example using for each component
prudhvivreddy
 
ODP
Howtouseforeachcomponent
akshay yeluru
 
PPTX
For each component in mule
Rajkattamuri
 
PPTX
Splitter
sivachandra mandalapu
 
PPTX
Sftplite
sivachandra mandalapu
 
PPTX
Mule message processor or routers
sathyaraj Anand
 
Expression filter in Mule
Mohammed246
 
How to use expression filter
Praneethchampion
 
How to use splitter component
RaviRajuRamaKrishna
 
Filter expression in mule
Rajkattamuri
 
Quartz component in mule
javeed_mhd
 
Basic example using for each component
prudhvivreddy
 
Howtouseforeachcomponent
akshay yeluru
 
For each component in mule
Rajkattamuri
 
Mule message processor or routers
sathyaraj Anand
 

Viewers also liked (20)

PPTX
Deployment options for mule applications
sivachandra mandalapu
 
PPTX
How to use Request Reply scope
sivachandra mandalapu
 
PDF
Ankur (Bestseller Marathi Poetry) Dr. Shriiwas Kashalikar
ahoskeri
 
PDF
hazardous locations
shahin tavakoli
 
PDF
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
P.L.T. Forniture Industriali S.r.l.
 
PPTX
Rest Component
sivachandra mandalapu
 
PDF
abbreviations in merchant seamen's records
shahin tavakoli
 
DOCX
Mumtaz Mehmood CV
Mumtaz Mehmood
 
PPTX
Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)
Aristides Faria
 
PDF
H2S awareness Mulholland
Peter Mulholland
 
PPTX
How to use secure property placeholder
sivachandra mandalapu
 
PPTX
Cloud hub deployment
sivachandra mandalapu
 
PPTX
Bean as Datasource
sivachandra mandalapu
 
PDF
Maulan muhammad umar ichravi ki ilmi khidmat by hamda shahid
Muhammad Tariq
 
PPTX
How to use jms inbound endpoint
sivachandra mandalapu
 
PPSX
The summary of my beloved Prophet Hazrat Muhammad ﷺ.
NURVSoft
 
PPTX
Securing api with_o_auth2
sivachandra mandalapu
 
Deployment options for mule applications
sivachandra mandalapu
 
How to use Request Reply scope
sivachandra mandalapu
 
Ankur (Bestseller Marathi Poetry) Dr. Shriiwas Kashalikar
ahoskeri
 
hazardous locations
shahin tavakoli
 
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
P.L.T. Forniture Industriali S.r.l.
 
Rest Component
sivachandra mandalapu
 
abbreviations in merchant seamen's records
shahin tavakoli
 
Mumtaz Mehmood CV
Mumtaz Mehmood
 
Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)
Aristides Faria
 
H2S awareness Mulholland
Peter Mulholland
 
How to use secure property placeholder
sivachandra mandalapu
 
Cloud hub deployment
sivachandra mandalapu
 
Bean as Datasource
sivachandra mandalapu
 
Maulan muhammad umar ichravi ki ilmi khidmat by hamda shahid
Muhammad Tariq
 
How to use jms inbound endpoint
sivachandra mandalapu
 
The summary of my beloved Prophet Hazrat Muhammad ﷺ.
NURVSoft
 
Securing api with_o_auth2
sivachandra mandalapu
 
Ad

Similar to Reference exception strategy (16)

PPTX
Using JSON Schema Validator
Rahul Kumar
 
PPTX
Validate json schema component
Ankit Lawaniya
 
PPT
Mule exception strategies - Reference Exception Strategy
Ankush Sharma
 
PPT
Mule exception strategies - Choice Exception Strategy
Ankush Sharma
 
PPTX
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
PPTX
Elements in a mule flow
Sindhu VL
 
PPTX
Elements in a muleflow
Thang Loi
 
ODP
Mule scopes&amp;error handling
Sumit Gole
 
PPTX
Exception handling in mule
nagarajupatangay
 
PPTX
Mule Schema Validation Filter
Ankush Sharma
 
PPTX
Mule JSON Schema Validator
Ankush Sharma
 
PPTX
Mule soft meetup__dubai_12_june- Error Handling
satyasekhar123
 
PPTX
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Om Prakash
 
PPTX
Virtual MuleSoft Meetup may_2020
Om Prakash
 
ODP
Exception handling basics in mule
himajareddys
 
PPTX
Validate Soap Request in Mule
irfan1008
 
Using JSON Schema Validator
Rahul Kumar
 
Validate json schema component
Ankit Lawaniya
 
Mule exception strategies - Reference Exception Strategy
Ankush Sharma
 
Mule exception strategies - Choice Exception Strategy
Ankush Sharma
 
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
Elements in a mule flow
Sindhu VL
 
Elements in a muleflow
Thang Loi
 
Mule scopes&amp;error handling
Sumit Gole
 
Exception handling in mule
nagarajupatangay
 
Mule Schema Validation Filter
Ankush Sharma
 
Mule JSON Schema Validator
Ankush Sharma
 
Mule soft meetup__dubai_12_june- Error Handling
satyasekhar123
 
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Om Prakash
 
Virtual MuleSoft Meetup may_2020
Om Prakash
 
Exception handling basics in mule
himajareddys
 
Validate Soap Request in Mule
irfan1008
 
Ad

More from sivachandra mandalapu (13)

PPTX
Mock component in munit
sivachandra mandalapu
 
PPTX
Jms selector
sivachandra mandalapu
 
PPTX
Object store
sivachandra mandalapu
 
PPTX
How to use SFTP
sivachandra mandalapu
 
PPTX
Setting up organization with api access
sivachandra mandalapu
 
PPTX
API gateway setup
sivachandra mandalapu
 
PPTX
Expression
sivachandra mandalapu
 
PPTX
Synchronous communication using jms back channel
sivachandra mandalapu
 
PPTX
Soap Component
sivachandra mandalapu
 
PPTX
Integration with dropbox using mule esb
sivachandra mandalapu
 
PPTX
Integration of mule esb with microsoft azure
sivachandra mandalapu
 
PPTX
Not Filter
sivachandra mandalapu
 
Mock component in munit
sivachandra mandalapu
 
Jms selector
sivachandra mandalapu
 
Object store
sivachandra mandalapu
 
How to use SFTP
sivachandra mandalapu
 
Setting up organization with api access
sivachandra mandalapu
 
API gateway setup
sivachandra mandalapu
 
Synchronous communication using jms back channel
sivachandra mandalapu
 
Soap Component
sivachandra mandalapu
 
Integration with dropbox using mule esb
sivachandra mandalapu
 
Integration of mule esb with microsoft azure
sivachandra mandalapu
 

Recently uploaded (20)

PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PPTX
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
PPTX
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PDF
I3PM Case study smart parking 2025 with uptoIP® and ABP
MIPLM
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PPTX
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PPTX
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
I3PM Case study smart parking 2025 with uptoIP® and ABP
MIPLM
 
epi editorial commitee meeting presentation
MIPLM
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 
Introduction presentation of the patentbutler tool
MIPLM
 
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 

Reference exception strategy

  • 2. Abstract • The main motto of this PPT is How to use Reference Exception Strategy in our applications.
  • 3. Introduction • You can create one or more global exception strategies to reuse in flows throughout your entire Mule application. First, create a global exception strategy, then add a Reference Exception Strategy to a flow to apply the error handling behavior of a specific global exception strategy.
  • 5. .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" • xmlns:spring="http://www.springframework.org/schema/beans" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd • http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> • <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8087" doc:name="HTTP Listener Configuration"/> • <flow name="JsonSchemaValidatorFlow"> • <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> • <json:validate-schema schemaLocation="Schema.json" doc:name="Validate JSON Schema"/> • <logger message="--Valid input" level="INFO" doc:name="Logger"/> • <exception-strategy ref="JsonSchemaValidatorCatch_Exception_Strategy" doc:name="Reference Exception Strategy"/> • </flow> • <catch-exception-strategy name="JsonSchemaValidatorCatch_Exception_Strategy"> • <set-property propertyName="http.status" value="400" doc:name="Property"/> • <set-payload value="Invalid input request" doc:name="Set Payload"/> • </catch-exception-strategy> • </mule>
  • 6. • Place the schema file in src/main/resources
  • 7. • Output: • If the input is valid input: • INFO 2016-12-22 09:23:32,157 [[JsonSchemaValidator].HTTP_Listener_Config uration.worker.02] org.mule.api.processor.LoggerMessageProcess or: --Valid input
  • 8. • If the input is invalid input: • ERROR 2016-12-22 09:23:15,139 [[JsonSchemaValidator].HTTP_Listener_Configuration.worker.02] org.mule.exception.DefaultMessagingExceptionStrategy: • ******************************************************************************** • Message : Json content is not compliant with schema • com.github.fge.jsonschema.core.report.ListProcessingReport: failure • --- BEGIN MESSAGES --- • error: object has missing required properties (["firstName"]) • level: "error" • schema: {"loadingURI":"file:/C:/Users/sivachandra.mandalap/AnypointStudio/workspace1/.mule/apps/JsonSchemaValidator/classes/Schema.json#","pointer":""} • instance: {"pointer":""} • domain: "validation" • keyword: "required" • required: ["firstName","lastName"] • missing: ["firstName"] • --- END MESSAGES --- • Payload : {"lastName":"def","age":10} • Payload Type : java.lang.String • Element : /JsonSchemaValidatorFlow/processors/0 @ JsonSchemaValidator • -------------------------------------------------------------------------------- • Root Exception stack trace: • org.mule.module.json.validation.JsonSchemaValidationException: Json content is not compliant with schema • com.github.fge.jsonschema.core.report.ListProcessingReport: failure • --- BEGIN MESSAGES --- • error: object has missing required properties (["firstName"]) • level: "error" • schema: {"loadingURI":"file:/C:/Users/sivachandra.mandalap/AnypointStudio/workspace1/.mule/apps/JsonSchemaValidator/classes/Schema.json#","pointer":""} • instance: {"pointer":""} • domain: "validation" • keyword: "required" • required: ["firstName","lastName"] • missing: ["firstName"] • --- END MESSAGES --- • at org.mule.module.json.validation.JsonSchemaValidator.validate(JsonSchemaValidator.java:286) • at org.mule.module.json.validation.ValidateJsonSchemaMessageProcessor.process(ValidateJsonSchemaMessageProcessor.java:46) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  • 9. • Flow of execution: 1. URL to trigger the service from browser Valid Request: