Though it might seem convenient to keep your Mule configurations in one file,
a very large XML file quickly becomes unmanageable. This is why
MuleSoft recommends that you split monolithic configurations into several files, and leverage Mule’s capacity to load multiple configuration files at application start-up time.
Splitting configurations into multiple files encourages reuse across teams.
Mule offers two options for loading multiple configuration files:
-
Side-by-side: Provide a list of independent configuration files to load.
-
Imported: Have one configuration file import several others, which in turn, can
import other files.
In practice, it’s common to use both approaches simultaneously.
Because configuration files are loaded in the same context,
you must use unique names for the configuration elements. Mule will not load an application if its configuration files have name conflicts.
Here are some suggested ways to determine where to split configuration elements into separate files and which elements to keep together:
-
Business domains usually form a natural border that you can use to separate
configuration elements.
-
Keep together elements that have been changed for similar reasons. This reduces the risk of impacting unrelated aspects of your application.
-
Technical elements, such as administrative components, security, and external system configurations determine good separation lines.
-
Separate a side-by-side connector configuration to facilitate functional testing.
(This suggestion does not apply to environment-specific connector configurations, which use properties files.)
-
Consider reuse across teams and projects when you separate configuration elements.
|
|
By default, Mule treats all XML configuration files as configurations
when an application is packaged and loaded in the side-by-side fashion.
|