Contact Free trial Login

Scheduler XML Reference

A XML for the Scheduler has these elements:

  • scheduler parent element that encloses the rest of the elements.

  • scheduling-strategy block inside scheduler.

  • fixed-frequency or cron element inside the scheduling-strategy block.

Properties of Fixed Frequency (<fixed-frequency>)

Attribute Description Example

frequency

Triggering frequency, relative to time unit. When set to 0 or a negative value, it switches to the default (1 minute).

frequency="1000"

timeUnit

The time unit for the frequency and startDelay values:

MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS

timeUnit="MILLISECONDS"

startDelay

Upon triggering the flow for the first time, Mule delays the first execution of the scheduler for a specific amount of time. This time period is expressed in the same time units as the frequency.

startDelay="0"

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

    <flow name="componentsFlow">
        <scheduler>
            <scheduling-strategy>
                <fixed-frequency startDelay="5" frequency="10" timeUnit="SECONDS"/>
            </scheduling-strategy>
        </scheduler>
        <logger message="my message"/>
    </flow>

</mule>

Properties of Cron (<cron>)

For more complex scheduling strategies, you can use a cron expression.

Parameter Default Value Description Example

expression

-

Use a cron expression for when to do a trigger.

expression="1 1 1 1,7 * ?"

timeZone

Time zone passed as system property, or in machine’s operating system.

Timezone in Java time zone format

timeZone="America/Argentina/Buenos_Aires"

Example that uses a cron expression:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

    <flow name="componentsFlow">
        <scheduler>
            <scheduling-strategy>
                <cron expression="0 0 12 * * ?"/>
            </scheduling-strategy>
        </scheduler>
        <logger message="my message"/>
    </flow>

</mule>

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.