...
- 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 WSO2 EI starts by using the
once
attribute.
Anchor | ||||
---|---|---|---|---|
|
Info | ||
---|---|---|
| ||
In a clustered environment, tasks are distributed among server nodes according to the round-robin method, by default. If required, you can change this default task handling behavior as explained here.Also, note that a scheduled task will only run in one of the nodes (at a given so that tasks are distributed randomly, or according to a specific rule. This is a server-level setting that is configured in the
Also, note that a scheduled task will only run on one of the nodes (at a given time) in a clustered environment. The task will failover to another node, only if the first node fails. |
Having deployed a task implementation to the ESB profile (see Writing Tasks), you can use the 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 or XML configuration to add and schedule tasks.
...
- Task Name - Name of a scheduled task.
- Task Group - The group name to grouping tasks. The group name
synapse.simple.quartz
belongs to the ESB profile - 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 the ESB profile (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 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 - The list of ESB server nodes that will run the task. You can specify the IP addresses of the required nodes. the task. You can specify the IP addresses of the required nodes.Anchor pinned_servers pinned_servers
(specified by this setting) at a time. The task will failover to another node specified here, only if the first node failsInfo This setting can be used if you want the task to run on a selected set of nodes in an ESB cluster. Note that the task will only run on one of the nodes at a time. It will failover to another node, only if the first node
fails.
As explained above, pinned servers will override the default task handling behavior defined at server-level (for this particular task). However, if rule-based task handling is specified at server-level, you need to ensure that the same server nodes you specify as pinned servers for the task are also specified for the task handling rule at server-level.
7. Click Load Task Properties to see the instance properties of the task implementation.
...