user1493140
user1493140

Reputation: 6186

Exception Strategy for a mule application using multiple "mule config xmls"

I have a question regarding how global exception strategy will be applied by mule for an application using multiple configuration XML files. Let me try to explain my confusion. Assuming that I have 4 mule configuration XMLs (each mule config XML has one or more flows) in my application and out of these 1 has defined a global exception strategy. Other config XMLs have flows that don't have any custom exception handling i.e. they use the default exception strategy provided by mule.

Now the question is -- "While the application is running if it encounters an exception and the exception happens in of flow which is defined in the XML without global exception strategy"

Will this exception be handled by the the global exception strategy defined in one of the XML's? OR handled by config XML containing the flow.

My expectation is that the global exception strategy defined in a particular XML file will ONLY handle the exceptions that occur in the flows within that XML only.

However I will appreciate if you guys can shed some more light on this subject.

Upvotes: 1

Views: 603

Answers (2)

Nithya K
Nithya K

Reputation: 1

To use the global exception strategy across all other configuration Xml files in the project, define a global Configuration.

E.g. If the global exception strategy is defined in 'global.xml', in that xml -> go to Global Elements - Add a new 'Configuration' and choose the defined global exception strategy in the dropdown 'Default exception strategy'.

Upvotes: 0

David Dossot
David Dossot

Reputation: 33413

When Mule loads multiple XML configuration files, it behaves as if there was only one, ie all the globally defined elements (transformers, components, security managers and exception strategies) are available to all flows everywhere.

Upvotes: 2

Related Questions