SlideShare a Scribd company logo
1 of 11
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

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 applicationssivachandra 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 Kashalikarahoskeri
 
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...
Сантехника Incea – Сделано в Италии от Stockist Italy – информация на 07 мая ...P.L.T. Forniture Industriali S.r.l.
 
abbreviations in merchant seamen's records
abbreviations in merchant seamen's recordsabbreviations in merchant seamen's records
abbreviations in merchant seamen's recordsshahin tavakoli
 
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
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholdersivachandra 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 shahidMuhammad Tariq
 
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
 

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 in mule
Choice component in mule Choice component in mule
Choice component in mule Rajkattamuri
 
Choice component
Choice component Choice component
Choice component F K
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice componentDivyaSree1391
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice componentmaheshtheapex
 
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 callprathyusha vadla
 
Message properties component
Message properties component Message properties component
Message properties component Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties componentF K
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentirfan1008
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentPhaniu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmdfkhan625
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentprinceirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentSunil Komarapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentKhasim Saheb
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 

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
Choice component Choice component
Choice component
 
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
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
 
How to use choice component
How to use choice componentHow to use choice component
How to use 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
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
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 (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

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

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: