Contact Free trial Login

Configuring Properties

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

This page describes configuring properties, such as property placeholders and system properties.

Property Placeholders

You can use Ant-style property placeholders in your Mule ESB configuration. For example:

<smtp:outbound-endpoint user="${smtp.username}" password="${smtp.password}"/>

The values for these placeholders can be made available in a variety of ways, as described in the sections below.

Global Properties

You can use the <global-property> element to set a placeholder value from within your Mule configuration, such as from within another Mule configuration file:

<global-property name="smtp.username" value="JSmith"/>
<global-property name="smtp.password" value="ChangeMe"/>

Properties Files

To load properties from a file, you can use the standard Spring element <context:property-placeholder>:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns=""

<context:property-placeholder location=""/>

<flow name="myProject_flow1">
    <logger message="${propertyFromFile}" doc:name="System Property Set in Property File"/>

where the contents of is:


To load multiple properties files, separate them with commas:

<context:property-placeholder location=",,"/>

Message Properties

You can use placeholders to perform logic on message properties such as the header. For example, if you wanted to evaluate the content-type portion of the message header, you would specify it as #[message.inboundProperties['Content-Type']]. Typically, you use message property placeholders with expressions. For more information, see Mule Expression Language MEL.

System Properties

The placeholder value can come from a JDK system property. If you start Mule from the command line, you would specify the properties as follows:

mule -D-M-Dsmtp.username=JSmith -D-M-Dsmtp.password=ChangeMe

or edit the system properties in conf/wrapper.conf if you are deploying Mule as a webapp. When running Mule in a container, as of Mule 2.2.2 you can also specify the server ID in the web.xml file as follows:


If you start Mule programmatically, you would specify the properties as follows before creating and starting the Mule context:

System.getProperties().put("smtp.username", "JSmith");
System.getProperties().put("smtp.password", "ChangeMe");

There are also several system properties that are immutable after startup. To set these, you customize the MuleConfiguration using the set method for the property (such as setId for the system ID), create a MuleContextBuilder, load the configuration to the builder, and then create the context from the builder.

For example:

SpringXmlConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder("my-config.xml");
DefaultMuleConfiguration muleConfig = new DefaultMuleConfiguration();
MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
MuleContextFactory contextFactory = new DefaultMuleContextFactory();
MuleContext muleContext = contextFactory.createMuleContext(configBuilder, contextBuilder);

For information on the set methods you can use to set system properties, see:

For information on configuration builders, see About Configuration Builders.

Environment Variables

There are several ways to access environment variables, but there is no standard way.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub