Scheduled Tasks

A Task is a custom Java class that implements the org.apache.synapse.startup.Task interface that defines a single public void execute() method.. These tasks can be scheduled and managed using the WSO2 Enterprise Service Bus (ESB). Tasks can be scheduled in a cron format or a simple format. A task can be specified as a one-time task, if required, and can be used to trigger a callout or send a message to the WSO2 ESB

Scheduling a Task

  1. In the navigator, under Configure, click Scheduled Tasks. The Scheduled Tasks page appears.
  2. Click Add Task. Add New Scheduled Task

    Figure 1. Scheduled Tasks Panel

  3. Enter the required details and click Schedule. Field Descriptions

Scheduled Task configuration panel

Figure 2. New Scheduled Task Configuration Panel

Field Descriptions

Scheduled Tasks
Field Name Description
Task Name Name of the scheduled task
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. ESB sample 300 demonstrates this.
Trigger Type Trigger type for the task. This can be either Simple or Cron. A simple trigger is defined by specifying a 'count' and an 'interval', implying that the task will run a 'count' number of times at specified intervals. A cron trigger is 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 Provide a list of ESB server names where this task should be started for the Pinned server value.