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

Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Mohammed246
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
Praneethchampion
 
Data Mapper
Data MapperData Mapper
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
RaviRajuRamaKrishna
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Rajkattamuri
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
javeed_mhd
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
prudhvivreddy
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
akshay yeluru
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Splitter
SplitterSplitter
Sftplite
SftpliteSftplite
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
sathyaraj Anand
 

What's hot (12)

Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
 
Data Mapper
Data MapperData Mapper
Data Mapper
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Splitter
SplitterSplitter
Splitter
 
Sftplite
SftpliteSftplite
Sftplite
 
Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 

Viewers also liked

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

Viewers also liked (20)

Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
How to use Request Reply scope
How to use Request Reply scopeHow to use Request Reply scope
How to use Request Reply scope
 
Project2
Project2Project2
Project2
 
Ankur (Bestseller Marathi Poetry) Dr. Shriiwas Kashalikar
Ankur (Bestseller Marathi Poetry) Dr. Shriiwas KashalikarAnkur (Bestseller Marathi Poetry) Dr. Shriiwas Kashalikar
Ankur (Bestseller Marathi Poetry) Dr. Shriiwas Kashalikar
 
hazardous locations
hazardous locationshazardous locations
hazardous locations
 
Project-- 2
Project-- 2Project-- 2
Project-- 2
 
конференція 26 05 16
конференція 26 05 16конференція 26 05 16
конференція 26 05 16
 
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
 
Rest Component
Rest ComponentRest Component
Rest Component
 
abbreviations in merchant seamen's records
abbreviations in merchant seamen's recordsabbreviations in merchant seamen's records
abbreviations in merchant seamen's records
 
Mumtaz Mehmood CV
Mumtaz Mehmood CVMumtaz Mehmood CV
Mumtaz Mehmood CV
 
Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)
Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)
Disciplina Marketing e Turismo (IFSP Campus Cubatao) (aula 04)
 
H2S awareness Mulholland
H2S awareness             MulhollandH2S awareness             Mulholland
H2S awareness Mulholland
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 
Maulan muhammad umar ichravi ki ilmi khidmat by hamda shahid
Maulan muhammad umar ichravi ki ilmi khidmat by hamda shahidMaulan muhammad umar ichravi ki ilmi khidmat by hamda shahid
Maulan muhammad umar ichravi ki ilmi khidmat by hamda shahid
 
How to use jms inbound endpoint
How to use jms inbound endpointHow to use jms inbound endpoint
How to use jms inbound endpoint
 
The summary of my beloved Prophet Hazrat Muhammad ﷺ.
The summary of my beloved Prophet Hazrat Muhammad ﷺ.The summary of my beloved Prophet Hazrat Muhammad ﷺ.
The summary of my beloved Prophet Hazrat Muhammad ﷺ.
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 

Similar to Reference exception strategy

Choice component
Choice component Choice component
Choice component
Sunil Komarapu
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
Rajkattamuri
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
javeed_mhd
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
AbdulImrankhan7
 
Choice component
Choice component Choice component
Choice component
F K
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice component
maheshtheapex
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
DivyaSree1391
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
prathyusha vadla
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
javeed_mhd
 
Message properties component
Message properties component Message properties component
Message properties component
Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties component
F K
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
maheshtheapex
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
princeirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
irfan1008
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Phaniu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
mdfkhan625
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Sunil Komarapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Anand kalla
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
Khan625
 

Similar to Reference exception strategy (20)

Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
 
Choice component
Choice component Choice component
Choice component
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice component
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Message properties component
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 

More from sivachandra mandalapu

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
sivachandra mandalapu
 
Jms selector
Jms selectorJms selector
Jms selector
sivachandra mandalapu
 
Object store
Object storeObject store
Object store
sivachandra mandalapu
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
sivachandra mandalapu
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
sivachandra mandalapu
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
sivachandra mandalapu
 
Expression
ExpressionExpression
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
sivachandra mandalapu
 
Sap
SapSap
Soap Component
Soap ComponentSoap Component
Soap Component
sivachandra mandalapu
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
sivachandra mandalapu
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
sivachandra mandalapu
 
Not Filter
Not FilterNot Filter

More from sivachandra mandalapu (13)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Object store
Object storeObject store
Object store
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Expression
ExpressionExpression
Expression
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Sap
SapSap
Sap
 
Soap Component
Soap ComponentSoap Component
Soap Component
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
 
Not Filter
Not FilterNot Filter
Not Filter
 

Recently uploaded

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
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
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 

Recently uploaded (20)

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
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
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 

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: