Contact Free trial Login

System Properties

You can use system properties to specify or override property placeholder values that a connector or component in a Mule app uses. MuleSoft recommends this practice when you are deploying your app to a new environment and need to override values in configuration property files for your Mule app.

You can manage system properties in these ways:

  • From Anypoint Studio through the Run Configurations window for the project.

  • From the command line for a standalone Mule instance.

Set System Properties in Anypoint Studio

You can add properties when you launch your project through the Package Explorer in Studio:

  1. Right-click the project for your Mule app in Package Explorer.

  2. Click Run AsRun Configurations.

  3. Pick the Arguments tab.

  4. Add your arguments to the VM Arguments field, prepending the property names with -D

    Arguments+Tab

    When you deploy your app through Studio, the new values for property placeholders will take precedence over other values set for those placeholders:

    <logger message="${propertyFromJVMArg}" doc:name="System Property Set in Studio through JVM args"/>

Set System Properties for On-Premises Deployments

For On-premises Mule instances, you can set and change system properties from the command line or define them in the wrapper.conf file.

Set System Properties when Starting Mule

Append -M-Dmule.<variable-name>=<value> to the mule or mule start command to set a system property.
Replace <variable-name> with your desired property name.
Replace <value> with the value to define for the property.

The following example starts Mule and defines two properties with different values:

$ mule start -M-Dmule.myEnv=prod -M-Dmule.myValue=1234

Set System Properties in the wrapper.conf File

Add wrapper.java.additional.<n> entries to the wrapper.conf file in the ${MULE_HOME}/conf directory, prepending property names with -D.

For example, to set Mule’s encoding:

Add wrapper.java.additional.999=-Dmule.encoding=ISO-8859-1 to the Wrapper configuration file.

If you add wrapper.java.additional.<n> entries to the configuration file, always change each instance of <n> to a new number that is not used, or Java does not parse the properties correctly.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.