Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To run every 5 seconds continuously:

Anchor
specified number of times
specified number of times

Code Block

<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask">
<trigger interval="5000"/>
</task>

To run every 5 seconds for 10 times:

Anchor
interval
interval

Code Block

<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask">
<trigger interval="5000" count="10"/>
</task>

You can also give cron-style values. To run daily at 1:30 AM:

Anchor
cron style
cron style

Code Block

<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask">
<trigger cron="30 1 * * * *"/>
</task>

To run only once after ESB starts:

Anchor
once
once

Code Block

<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask">
<trigger once="true"/>
</task>

...

  • Task Name - Name of a scheduled task.
  • Task Group - The group name to grouping tasks. The group name synapse.simple.quartz belongs to ESB - Synapse. All available groups are displayed as a drop-down menu. If there are tasks belong to some other domains, for example WSO2 Mashups tasks, then those will be shown here as a separate group names.
  • Task Implementation - The implementation class of the task. There is a default task implementation which is shipped with ESB. It is org.apache.synapse.startup.tasks.MessageInjector, which just injects a message specified into Synapse environment. See more information on how to write a custom task class in Writing Tasks, Sample 1 Introduction to Tasks with Simple Trigger and Writing Tasks Sample.
  • Trigger Type - Trigger type for the task. This can be selected as either "Simple" or "Cron."
    • Simple Trigger - Defined by specifying a count and an interval, implying that the task will run a count number of times at specified intervals.
    • Cron Trigger - Defined using a cron expression.
  • Count - The number of times the task will be executed.
  • Interval - The interval between consecutive executions of a task.
  • Pinned Servers - Provides a list of ESB server names, where this task should be started for the "Pinned Servers" value.

...

See an example of task scheduling here.

Excerpt
hiddentrue

Instructions on how to schedule tasks in WSO2 ESB.