Using Properties Files in Mule Configuration

In a previous post I looked at how to use quartz to trigger events in mule – we had a cron expression which dictated when an event occurred. This post explains how to externalise this cron expression to a properties file.

We create a properties file (application.properties) with the cron expression. This properties file should be on the classpath.

cron.expression=0 24 15 * * ?

First we reference our properties file in the mule config:

<environment-properties>
  <file-properties location="application.properties"/>
</environment-properties>

We can then use the same syntax as Spring to acces the parameter in the properties file:

<endpoint name="quartz.in" address="quartz:/myService">
  <properties>
    <property name="cronExpression" value="${cron.expression}" />
  </properties>
</endpoint>

This example shows how to externalise configuration properties to a properties file.

Leave a Reply