Saturday 14 May 2016

Create schedulers in websphere.

You can create multiple schedulers within a single server, cluster, node or cell. Each configured scheduler is an independent task scheduling engine that has a unique Java Naming and Directory Interface (JNDI) name, persistent storage device and daemon.

Procedure

  1. Configure schedulers.
  2. Create the database for schedulers(same as our data source creation)

1) Set scheduler in WebSphere console (you'll need database connection set as well, because scheduler automaticly creates few tables for managing tasks)

Go to resources -> schedulers -> new

Set JNDI name by which you'll call Scheduler from your application (in this example, it will be sched/testScheduler), and ofcourse choose database conneciton.

Poll interval - i'm not sure what is purpose of it because i set interval for tasks in application, but anyway i set it to 30min.

Table prefix - i guess choose whatever you prefer

Now after you created new Scheduler, select it in table (resources -> schedulers) and click 'Create tables'.

Results

A scheduler is now configured and ready to use for newly installed applications. If the scheduler JNDI name is not yet visible to your application, restarting the application or restarting application server will allow the scheduler to be seen.
When schedulers are created for the first time, the poll daemon will not automatically start and must be started manually and will only start automatically the next time the server is started. To start the poll daemon manually, refer to the scheduler daemons topic.
Attention: Changes to existing scheduler configurations will not take affect until after the application server is restarted.