<?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 doc:name="Scheduler" disallowConcurrentExecution="true">
<scheduling-strategy >
<fixed-frequency frequency="1000"/>
</scheduling-strategy>
</scheduler>
</flow>
</mule>
Scheduler XML Reference
A XML for the Scheduler has these elements:
-
scheduler
parent element that encloses the rest of the elements. -
scheduling-strategy
block insidescheduler
. -
fixed-frequency
orcron
element inside thescheduling-strategy
block.
<scheduler>
Properties
Attribute | Description | Example |
---|---|---|
|
Skips the next scheduled flow execution if the last one has not ended. Next attempt to execute will be after another frequency period. Default value is |
|
<fixed-frequency>
Properties
Attribute | Description | Example |
---|---|---|
|
Triggering frequency, relative to time unit. When set to |
|
|
The time unit for the frequency and startDelay values: MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS |
|
|
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. |
|
<?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>
<cron>
Properties
For more complex scheduling strategies, you can use a cron expression.
Parameter | Default Value | Description | Example |
---|---|---|---|
|
- |
Use a cron expression for when to do a trigger. |
|
|
Time zone passed as system property, or in machine’s operating system. |
Timezone in Java time zone format |
|
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>