...
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:
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:
Code Block |
---|
<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask">
<trigger cron="30 1 * * * *"/>
</task>
|
To run only once after ESB starts:
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 |
---|
|
Instructions on how to schedule tasks in WSO2 ESB. |