Contact Free trial Login

Introduction to Mule 4: Configuring Mule Apps

Although Mule 3 required you to know how to use Spring property placeholders to configure apps dynamically for the environment in which they are deployed, Mule 4 contains a built-in mechanism that enables you to set default values in a YAML file.

Mule 3 supports .properties configuration files, while Mule 4 supports both .yaml and .properties configuration files. The recommended approach is to use .yaml configuration files, because it allows the addition of type validations and autocompletion.

Following is an example of a .yaml configuration file:

http:
  path: service
  port: "10000"

You can add the YAML file to your Mule app through the Configuration Properties Global Element. The XML configuration looks like this:

<configuration-properties file="myConfiguration.yaml" />

In Mule 4, creating a new application via Anypoint Studio no longer automatically adds the default mule-app.properties file added in Mule 3.
If you choose to create a custom .properties file, you also need to configure it in your Mule app via the Configuration Properties Global Element. The XML configuration looks like this:

<configuration-properties file="myConfiguration.properties"/>

MuleSoft recommends that you not package the configuration files for all the environments inside your app. Instead, you should use a .yaml file to provide defaults, and then use Runtime Manager to override each of these properties at deployment time.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub