SlideShare a Scribd company logo
Specifying a default exception
strategy
Abstract
• The main motto of this PPT is How to use
Specifying a default exception strategy in our
applications.
Example
Specifying a default exception strategy
Specifying a default exception strategy
Specifying a default exception strategy
.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"/>
• </flow>
• </mule>
• Global flow:
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:cluster="http://www.mulesoft.org/schema/mule/ee/cluster"
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">
• <configuration defaultExceptionStrategy-ref="GlobalCatch_Exception_Strategy" doc:name="Configuration">
• <http:config useTransportForUris="false"/>
• </configuration>
• <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 10:03:37,163
[[ExceptionHandling].HTTP_Listener_Configuratio
n.worker.01]
org.mule.api.processor.LoggerMessageProcessor:
-Flow started
• INFO 2016-12-23 10:03:37,233
[[ExceptionHandling].HTTP_Listener_Configuratio
n.worker.01]
org.mule.api.processor.LoggerMessageProcessor:
--Token value: ----a1b2c3d4
Specifying a default exception strategy
• If the input is invalid input:
• INFO 2016-12-23 10:04:02,030 [[ExceptionHandling].HTTP_Listener_Configuration.worker.02]
org.mule.api.processor.LoggerMessageProcessor: -Flow started
• ERROR 2016-12-23 10:04:02,072 [[ExceptionHandling].HTTP_Listener_Configuration.worker.02]
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)
Specifying a default exception strategy
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.6/error-handling

More Related Content

What's hot (12)

PPTX
Expression filter in Mule
Mohammed246
 
PPTX
How to use expression filter
RaviRajuRamaKrishna
 
PPTX
Wildcard Filter
sivachandra mandalapu
 
PPTX
Expression Filters
Durga Prasad Kakarla
 
PPTX
Data Mapper
sivachandra mandalapu
 
PPTX
Filter expression in mule
Rajkattamuri
 
PPTX
Quartz component in mule
javeed_mhd
 
ODP
Howtouseforeachcomponent
akshay yeluru
 
PPTX
Splitter
sivachandra mandalapu
 
PPTX
Sftplite
sivachandra mandalapu
 
PPTX
For each component in mule
Rajkattamuri
 
PPTX
Jms selector
sivachandra mandalapu
 
Expression filter in Mule
Mohammed246
 
How to use expression filter
RaviRajuRamaKrishna
 
Wildcard Filter
sivachandra mandalapu
 
Expression Filters
Durga Prasad Kakarla
 
Filter expression in mule
Rajkattamuri
 
Quartz component in mule
javeed_mhd
 
Howtouseforeachcomponent
akshay yeluru
 
For each component in mule
Rajkattamuri
 
Jms selector
sivachandra mandalapu
 

Viewers also liked (17)

PDF
Tayyab ul warda fi sharha burda by allama abul hasnat syed muhammad ahmad qadri
Muhammad Tariq
 
PPTX
Disciplina Ecoturismo e Turismo de Aventura (IFSP Campus Cubatao) (aulas 12 a...
Aristides Faria
 
PDF
Manual aquarius 3 d map (versão 9 2012)
zeniltonbm
 
PPTX
And Filter
sivachandra mandalapu
 
PPTX
Cloud hub deployment
sivachandra mandalapu
 
PPTX
Bean as Datasource
sivachandra mandalapu
 
PPTX
How to use secure property placeholder
sivachandra mandalapu
 
PDF
Apresentação hipermade madeiras
HiperMade Comercio de Madeiras
 
PDF
IWCF Temporary Certificate
Charles Ahamefule
 
PPTX
Securing api with_o_auth2
sivachandra mandalapu
 
PPTX
How to use SFTP
sivachandra mandalapu
 
PPTX
Competitividade no setor de viagens e turismo
Aristides Faria
 
PPTX
Synchronous communication using jms back channel
sivachandra mandalapu
 
PPTX
Expression
sivachandra mandalapu
 
PPTX
API gateway setup
sivachandra mandalapu
 
PPTX
Setting up organization with api access
sivachandra mandalapu
 
Tayyab ul warda fi sharha burda by allama abul hasnat syed muhammad ahmad qadri
Muhammad Tariq
 
Disciplina Ecoturismo e Turismo de Aventura (IFSP Campus Cubatao) (aulas 12 a...
Aristides Faria
 
Manual aquarius 3 d map (versão 9 2012)
zeniltonbm
 
Cloud hub deployment
sivachandra mandalapu
 
Bean as Datasource
sivachandra mandalapu
 
How to use secure property placeholder
sivachandra mandalapu
 
Apresentação hipermade madeiras
HiperMade Comercio de Madeiras
 
IWCF Temporary Certificate
Charles Ahamefule
 
Securing api with_o_auth2
sivachandra mandalapu
 
How to use SFTP
sivachandra mandalapu
 
Competitividade no setor de viagens e turismo
Aristides Faria
 
Synchronous communication using jms back channel
sivachandra mandalapu
 
API gateway setup
sivachandra mandalapu
 
Setting up organization with api access
sivachandra mandalapu
 
Ad

Similar to Specifying a default exception strategy (20)

PPTX
How to use expression filter
Phaniu
 
PPTX
How to use expression filter
irfan1008
 
PPTX
How to use expression filter
mdfkhan625
 
PPTX
How to use expression filter
princeirfancivil
 
PPTX
How to use expression filter
Khasim Saheb
 
PPTX
How to use expression filter
Anand kalla
 
PPTX
How to use expression filter
Sunil Komarapu
 
PPTX
Filter expression
F K
 
PPTX
Filter expression
AbdulImrankhan7
 
PPTX
Filter expression in mule
javeed_mhd
 
PPTX
Filter expression
Sunil Komarapu
 
PPTX
How to use message properties component
mdfkhan625
 
PPTX
How to use message properties component
princeirfancivil
 
PPTX
How to use message properties component
irfan1008
 
PPTX
How to use message properties component
Phaniu
 
PPTX
How to use message properties component
maheshtheapex
 
PPTX
How to use message properties component
Sunil Komarapu
 
PPTX
How to use message properties component
Anand kalla
 
PPTX
Message properties component in Mule
Khan625
 
PPTX
How to use message properties component
Khasim Saheb
 
How to use expression filter
Phaniu
 
How to use expression filter
irfan1008
 
How to use expression filter
mdfkhan625
 
How to use expression filter
princeirfancivil
 
How to use expression filter
Khasim Saheb
 
How to use expression filter
Anand kalla
 
How to use expression filter
Sunil Komarapu
 
Filter expression
F K
 
Filter expression
AbdulImrankhan7
 
Filter expression in mule
javeed_mhd
 
Filter expression
Sunil Komarapu
 
How to use message properties component
mdfkhan625
 
How to use message properties component
princeirfancivil
 
How to use message properties component
irfan1008
 
How to use message properties component
Phaniu
 
How to use message properties component
maheshtheapex
 
How to use message properties component
Sunil Komarapu
 
How to use message properties component
Anand kalla
 
Message properties component in Mule
Khan625
 
How to use message properties component
Khasim Saheb
 
Ad

More from sivachandra mandalapu (8)

PPTX
Mock component in munit
sivachandra mandalapu
 
PPTX
Object store
sivachandra mandalapu
 
PPTX
Deployment options for mule applications
sivachandra mandalapu
 
PPTX
Soap Component
sivachandra mandalapu
 
PPTX
Rest Component
sivachandra mandalapu
 
PPTX
Integration with dropbox using mule esb
sivachandra mandalapu
 
PPTX
Integration of mule esb with microsoft azure
sivachandra mandalapu
 
PPTX
Not Filter
sivachandra mandalapu
 
Mock component in munit
sivachandra mandalapu
 
Object store
sivachandra mandalapu
 
Deployment options for mule applications
sivachandra mandalapu
 
Soap Component
sivachandra mandalapu
 
Rest Component
sivachandra mandalapu
 
Integration with dropbox using mule esb
sivachandra mandalapu
 
Integration of mule esb with microsoft azure
sivachandra mandalapu
 

Recently uploaded (20)

DOCX
Lesson 1 - Nature and Inquiry of Research
marvinnbustamante1
 
PPTX
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PDF
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
PDF
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
Building Powerful Agentic AI with Google ADK, MCP, RAG, and Ollama.pptx
Tamanna36
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Lesson 1 - Nature and Inquiry of Research
marvinnbustamante1
 
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
epi editorial commitee meeting presentation
MIPLM
 
Horarios de distribución de agua en julio
pegazohn1978
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Building Powerful Agentic AI with Google ADK, MCP, RAG, and Ollama.pptx
Tamanna36
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Controller Request and Response in Odoo18
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 

Specifying a default exception strategy

  • 1. Specifying a default exception strategy
  • 2. Abstract • The main motto of this PPT is How to use Specifying a default exception strategy in our applications.
  • 7. .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"/> • </flow> • </mule>
  • 8. • Global flow: • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:cluster="http://www.mulesoft.org/schema/mule/ee/cluster" 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"> • <configuration defaultExceptionStrategy-ref="GlobalCatch_Exception_Strategy" doc:name="Configuration"> • <http:config useTransportForUris="false"/> • </configuration> • <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>
  • 9. • Output: • If the input is valid input: • INFO 2016-12-23 10:03:37,163 [[ExceptionHandling].HTTP_Listener_Configuratio n.worker.01] org.mule.api.processor.LoggerMessageProcessor: -Flow started • INFO 2016-12-23 10:03:37,233 [[ExceptionHandling].HTTP_Listener_Configuratio n.worker.01] org.mule.api.processor.LoggerMessageProcessor: --Token value: ----a1b2c3d4
  • 11. • If the input is invalid input: • INFO 2016-12-23 10:04:02,030 [[ExceptionHandling].HTTP_Listener_Configuration.worker.02] org.mule.api.processor.LoggerMessageProcessor: -Flow started • ERROR 2016-12-23 10:04:02,072 [[ExceptionHandling].HTTP_Listener_Configuration.worker.02] 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)