...
- Using
count
andinterval
attributes to run the task a specified number of times at a given interval . - Giving the scheduled time as a cron style entry.
- Making the task run only once after the ESB WSO2 EI starts by using the
once
attribute.
Having deployed a task implementation to the ESB WSO2 EI runtime (see Writing Tasks), you can use the ESB WSO2 EI Management Console to add a task to the "Tasks" list and schedule various instances of the task. You can use either UI configuration or XML configuration to add and schedule tasks.
...
Follow the instructions below to add and schedule a task in ESB WSO2 EI Management Console.
1. Sign in. Enter your user name and password to log in to the ESB WSO2 EI Management Console.
2. Click Main in the left menu to access the Manage menu.
...
- Task Name - Name of a scheduled task.
- Task Group - The group name to grouping tasks. The group name
synapse.simple.quartz
belongs to ESB WSO2 EI - 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. To use the default task implementation that is available with the ESB WSO2 EI (and therefore can be used without downloading any third-party libraries or custom JARs), specify
org.apache.synapse.startup.tasks.MessageInjector
. This class simply injects a specified message into the Synapse environment at ESB WSO2 EI startup. For more information on writing custom task implementations, see Writing Tasks. - Trigger Type- Trigger type for the task. This can be selected as either "Simple" or "Cron."
- Simple Trigger - Defined by specifying a
count
and aninterval
, implying that the task will run acount
number of times at specified intervals.- Count - The number of times the task will be executed.
- Interval - The interval between consecutive executions of a task.
- Cron Trigger - Defined using a cron expression.
- Simple Trigger - Defined by specifying a
- Pinned Servers - Provides a list of ESB WSO2 EI server names, where this task should be started for the "Pinned Servers" value.
...
1. Sign in. Enter your user name and password to log on to the ESB WSO2 EI Management Console.
2. Click on "Main" in the left menu to access the "Manage" menu.
...
Anchor | ||||
---|---|---|---|---|
|
To run only once after ESB WSO2 EI starts:
Code Block |
---|
<task name="CheckPrice" class="org.wso2.esb.tutorial.tasks.PlaceStockOrderTask"> <trigger once="true"/> </task> |
...