Contact Us 1-800-596-4880

System Properties

This version of Mule reached its End of Life on May 2, 2023, when Extended Support ended.

Deployments of new applications to CloudHub that use this version of Mule are no longer allowed. Only in-place updates to applications are permitted.

MuleSoft recommends that you upgrade to the latest version of Mule 4 that is in Standard Support so that your applications run with the latest fixes and security enhancements.

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.