Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

To Configure Property Placeholders for Mule Apps

Instead of using static values for connections and other configurations in your Mule app, you can use the procedure described here to create and use property placeholders that you define in a .yaml or .properties configuration file.

In a YAML file, the properties take this form:

http:
  path: service
  port: "10000"

In a .properties file, the properties take this form:

http.path=service
http.port="10000"

You must store the file in the project directory for your Mule app:

  • /src/main/resources

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

<configuration-properties file="myConfiguration.yaml" doc:name="Configuration properties" doc:id="872422be-3571-4a52-a383-a2b0e16859d7" />

Once the attributes are configured, you can reference them using a syntax like this: ${http.path} and ${http.port}.

For example, your HTTP Listener might pass the port like this: <http:listener-connection host="0.0.0.0" port="${http.port}" />

In this topic: