SlideShare a Scribd company logo
Defining global exception strategies
Abstract
• The main motto of this PPT is How to use
Defining global exception strategies in our
applications.
Example
Defining global exception strategies
.mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
• <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8088" doc:name="HTTP
Listener Configuration"/>
• <flow name="ExceptionHandlingFlow">
• <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
• <logger message="-Flow started" level="INFO" doc:name="Logger"/>
• <set-property propertyName="token"
value="#[message.inboundProperties.'http.query.params'.token.toString()]" doc:name="Property"/>
• <logger message="--Token value: ----#[message.outboundProperties.token]" level="INFO"
doc:name="Logger"/>
• <set-payload value="{
• &quot;token&quot;:&quot;#[message.outboundProperties.token]&quot;
• }" doc:name="Set Payload"/>
• <exception-strategy ref="GlobalCatch_Exception_Strategy" doc:name="Reference Exception Strategy"/>
• </flow>
• </mule>
• Global flow:
• <?xml version="1.0" encoding="UTF-8"?>
• <mule 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">
• <catch-exception-strategy name="GlobalCatch_Exception_Strategy">
• <set-property propertyName="http.status" value="400" doc:name="Property"/>
• <set-payload value="{
• &quot;message&quot;:&quot;Bad Request&quot;
• }" doc:name="Set Payload"/>
• </catch-exception-strategy>
• </mule>
• Output:
• If the input is valid input:
• INFO 2016-12-23 09:50:35,930
[[ExceptionHandling].HTTP_Listener_Configuratio
n.worker.01]
org.mule.api.processor.LoggerMessageProcessor:
-Flow started
• INFO 2016-12-23 09:50:35,978
[[ExceptionHandling].HTTP_Listener_Configuratio
n.worker.01]
org.mule.api.processor.LoggerMessageProcessor:
--Token value: ----a1b2c3d4
Defining global exception strategies
• If the input is invalid input:
• NFO 2016-12-23 09:51:25,543 [[ExceptionHandling].HTTP_Listener_Configuration.worker.01]
org.mule.api.processor.LoggerMessageProcessor: -Flow started
• ERROR 2016-12-23 09:51:25,552 [[ExceptionHandling].HTTP_Listener_Configuration.worker.01]
org.mule.exception.CatchMessagingExceptionStrategy:
• ********************************************************************************
• Message : Execution of the expression
"message.inboundProperties.'http.query.params'.token.toString()" failed.
(org.mule.api.expression.ExpressionRuntimeException).
• Payload : {NullPayload}
• Element XML : <set-property propertyName="token"
value="#[message.inboundProperties.'http.query.params'.token.toString()]"
doc:name="Property"></set-property>
• Payload Type : org.mule.transport.NullPayload
• Element : /ExceptionHandlingFlow/processors/1 @
ExceptionHandling:ExceptionHandling.xml:13 (Property)
• --------------------------------------------------------------------------------
• Root Exception stack trace:
• java.lang.NullPointerException
• at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
• at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Defining global exception strategies
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.6/error-handling
Ad

More Related Content

What's hot (11)

Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
sivachandra mandalapu
 
Data Mapper
Data MapperData Mapper
Data Mapper
sivachandra mandalapu
 
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
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
akshay yeluru
 
Splitter
SplitterSplitter
Splitter
sivachandra mandalapu
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Sftplite
SftpliteSftplite
Sftplite
sivachandra mandalapu
 
Object store
Object storeObject store
Object store
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
 

Viewers also liked (18)

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
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
sivachandra mandalapu
 
Sap
SapSap
Sap
sivachandra mandalapu
 
Salesforce
SalesforceSalesforce
Salesforce
sivachandra mandalapu
 
Expression
ExpressionExpression
Expression
sivachandra mandalapu
 
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
 
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
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
sivachandra mandalapu
 
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
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
sivachandra mandalapu
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
sivachandra mandalapu
 
Dockerizing mule soft esb
Dockerizing mule soft esbDockerizing mule soft esb
Dockerizing mule soft esb
sivachandra mandalapu
 
How to use jms outbound endpoint
How to use jms outbound endpointHow to use jms outbound endpoint
How to use jms outbound endpoint
sivachandra mandalapu
 
How to use IMAP endpoint
How to use IMAP endpointHow to use IMAP endpoint
How to use IMAP endpoint
sivachandra mandalapu
 
How to use poll scope
How to use poll scopeHow to use poll scope
How to use poll scope
sivachandra mandalapu
 
Not Filter
Not FilterNot Filter
Not Filter
sivachandra mandalapu
 
Integrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share pointIntegrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share point
sivachandra mandalapu
 
Ad

Similar to Defining global exception strategies (20)

How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Phaniu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
irfan1008
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
mdfkhan625
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
princeirfancivil
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Anand kalla
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Sunil Komarapu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Khasim Saheb
 
Expression Filters
Expression FiltersExpression Filters
Expression Filters
Durga Prasad Kakarla
 
Filter expression
Filter expressionFilter expression
Filter expression
AbdulImrankhan7
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
javeed_mhd
 
Filter expression
Filter expression Filter expression
Filter expression
Sunil Komarapu
 
Filter expression
Filter expression Filter expression
Filter expression
F K
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
RaviRajuRamaKrishna
 
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
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 wildcard filter
How to use wildcard filterHow to use wildcard filter
How to use wildcard filter
RaviRajuRamaKrishna
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
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 expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Phaniu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
irfan1008
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
mdfkhan625
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
princeirfancivil
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Anand kalla
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Sunil Komarapu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Khasim Saheb
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
javeed_mhd
 
Filter expression
Filter expression Filter expression
Filter expression
Sunil Komarapu
 
Filter expression
Filter expression Filter expression
Filter expression
F K
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
RaviRajuRamaKrishna
 
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
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 wildcard filter
How to use wildcard filterHow to use wildcard filter
How to use wildcard filter
RaviRajuRamaKrishna
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
maheshtheapex
 
Ad

Recently uploaded (20)

SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 

Defining global exception strategies

  • 2. Abstract • The main motto of this PPT is How to use Defining global exception strategies in our applications.
  • 5. .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" 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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> • <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8088" doc:name="HTTP Listener Configuration"/> • <flow name="ExceptionHandlingFlow"> • <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> • <logger message="-Flow started" level="INFO" doc:name="Logger"/> • <set-property propertyName="token" value="#[message.inboundProperties.'http.query.params'.token.toString()]" doc:name="Property"/> • <logger message="--Token value: ----#[message.outboundProperties.token]" level="INFO" doc:name="Logger"/> • <set-payload value="{ • &quot;token&quot;:&quot;#[message.outboundProperties.token]&quot; • }" doc:name="Set Payload"/> • <exception-strategy ref="GlobalCatch_Exception_Strategy" doc:name="Reference Exception Strategy"/> • </flow> • </mule>
  • 6. • Global flow: • <?xml version="1.0" encoding="UTF-8"?> • <mule 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"> • <catch-exception-strategy name="GlobalCatch_Exception_Strategy"> • <set-property propertyName="http.status" value="400" doc:name="Property"/> • <set-payload value="{ • &quot;message&quot;:&quot;Bad Request&quot; • }" doc:name="Set Payload"/> • </catch-exception-strategy> • </mule>
  • 7. • Output: • If the input is valid input: • INFO 2016-12-23 09:50:35,930 [[ExceptionHandling].HTTP_Listener_Configuratio n.worker.01] org.mule.api.processor.LoggerMessageProcessor: -Flow started • INFO 2016-12-23 09:50:35,978 [[ExceptionHandling].HTTP_Listener_Configuratio n.worker.01] org.mule.api.processor.LoggerMessageProcessor: --Token value: ----a1b2c3d4
  • 9. • If the input is invalid input: • NFO 2016-12-23 09:51:25,543 [[ExceptionHandling].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: -Flow started • ERROR 2016-12-23 09:51:25,552 [[ExceptionHandling].HTTP_Listener_Configuration.worker.01] org.mule.exception.CatchMessagingExceptionStrategy: • ******************************************************************************** • Message : Execution of the expression "message.inboundProperties.'http.query.params'.token.toString()" failed. (org.mule.api.expression.ExpressionRuntimeException). • Payload : {NullPayload} • Element XML : <set-property propertyName="token" value="#[message.inboundProperties.'http.query.params'.token.toString()]" doc:name="Property"></set-property> • Payload Type : org.mule.transport.NullPayload • Element : /ExceptionHandlingFlow/processors/1 @ ExceptionHandling:ExceptionHandling.xml:13 (Property) • -------------------------------------------------------------------------------- • Root Exception stack trace: • java.lang.NullPointerException • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) • at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) • at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)