Managing Scheduler

Scheduler is a component of Adeptia Suite that manages events and triggers process flows based on the occurrence of events. The normal state of the Scheduler is Running. However, it may be required to pause or stop occasionally for system performance or maintenance reasons. When the scheduler is Paused or Stopped, no scheduler supported Event will be f ired.


Events managed by the scheduler (time-based events) are:

  • File Event
  • FTP Event
  • Mail Event
  • Database Event
  • Timer Event
  • Calendar Event


Self-driven events i.e. events that are not managed by the scheduler (action-based events) are:

  • JMS Event
  • HTTP Event


Misfire Event Handling
An event may not be fired at the scheduled time due to multiple reasons. These are outlined as:

When the event is not fired at the scheduled time, it is considered as a delayed event. The delayed event will be fired, when the thread becomes available or the system is not too busy. This will happen as long as delay is not more than misfire threshold. If delay is more than misfire threshold, event is considered as a misfired event. The misfire threshold is specified by following parameter defined in quartz.properties file:
org.quartz.jobStore.misfireThreshold = 10000
10000 = 10 Seconds
10 seconds is the default value of misfire threshold, which can be changed, based on your requirements.
Misfired events are handled based on two factors:

  • Smart Misfire Policy
  • Repeat Count


The Smart Misfire Policy is dependent on the Repeat Count value. In case of all events except Timer event, the Repeat Count value is Infinity. However, in case of a Timer event, the Repeat Count value is based on the Expiry Criteria value. This is described in the table below.
Table 4: Repeat Count Value of Timer Event and Misfire Policy

Expiry Criteria

Repeat Count

Misfire Policy

Timer Event- Run only Once

0

The misfired event will be triggered only once

Timer Event-Repeat Count specified value
e.g. 10

Specified value
e.g. 10

All misfired events and the remaining events will be triggered. The number of misfired event triggered at a time is controlled by
org.quartz.jobStore.maxMisfiresToHandleAtATime properties defined the quartz.properties file.

Timer Event-Expiry by Date/time or All other Events

Infinity

Only the remaining events will be triggered. All misfired events will be lost.

Firing of Events when Scheduler is Stopped
The events that are scheduled to fire while the scheduler is stopped will be fired upon restarting of the scheduler based on the Repeat Count value as described in Table 4 .

When the scheduler is stopped, events cannot be activated or deactivated.

When the scheduler is paused, events cannot be activated or deactivated.

Firing of Events when Scheduler is Paused
When the scheduler is paused, the events that are scheduled to be fired will not be triggered. When the scheduler is resumed, only the remaining events will be triggered. The misfired events will be lost.

 

Scheduler Related Properties

For scheduler related properties, you can refer to the quartz.properties file that is located in the .../AdeptiaSuite-XX/AdeptiaServer/ServerKernel/etc directory. These include:

org.quartz.jobStore.maxMisfiresToHandleAtATime

 

Description

This property is used to define the maximum number of misfired triggers that the jobstore can handle at a given time

Default Value

5

Possible Values

1-100

Selection Criteria

NA

Comments

If the jobstore handles many triggers at once then the database tables could get locked, thus hampering the performance of other triggers. This property limits the maximum number of misfired events that can be fired at a time. If there are numerous misfired events, then they are fired in batches.

 

org.quartz.jobStore.misfireThreshold

 

Description

This property is used to define the number of milliseconds that the scheduler will retain a trigger, before passing it to the next firing time, before it is considered as misfired

Default Value

10000

Possible Values

Any positive integer

Selection Criteria

Change the value of this property if you want to increase/decrease the misfire threshold value of the scheduler.

 

org.quartz.threadPool.threadCount

 

Description

This property is used to define the number of threads available for concurrent execution of jobs (for firing of events)

Default Value

15

Possible Values

1-100

Selection Criteria

NA

Comments

If only few jobs are fired a few times in a day, then 1 thread is sufficient. If thousands of jobs are fired every minute, then 50 or 100 threads are required, based on the jobs count and system resources.


Steps to manage the scheduler

  1. Click the Administer tab and then click Maintenance menu. All the options of Maintenance menu are displayed.
  2. Select the Scheduler option. The Manage Scheduler screen is displayed showing the status of scheduler.

     

  3. This screen is divided into two parts. The first part displays the status of the scheduler and allows you to change the status as and when required. The second part displays a list of events that are activated (only if scheduler is running). You can deactivate an event by clicking Deactivate against the event. This will deactivate the event and remove it from the list.

    The autoCleanup and autoLogCleanup events cannot be deactivated as they are generated by the system.

  4. To view an event, click the View link against the required event. The properties of the event are displayed.
  5. To stop the Scheduler, click Stop Scheduler button. A screen is displayed showing that scheduler stopped successfully.
  6. To start the scheduler, on the Change Scheduler State screen, click Start Scheduler. A screen is displayed showing that the scheduler started successfully.
  7. To pause the Scheduler, click Pause Scheduler button. A screen is displayed showing that scheduler stopped successfully.

    The Pause Scheduler button changes to Resume Scheduler, once the scheduler is paused.
    When the scheduler is Stopped or Paused, the list of activated events is not displayed.

  8. To resume the scheduler, click Resume Scheduler button. This resumes the scheduler and displays the scheduler screen.

8