job scheduler in pega

 

What is Job Scheduler?

  • As the name implies it is used to schedule jobs.
  • Job scheduler got introduced on Pega infinity (Pega 8) release and set to replace the advanced agent rules.
  • It belongs to SysAdmin category.

Create a new Job Scheduler

Records -> SysAdmin -> Job Scheduler -> Create new

Note: If you don’t see it in admin studio, make sure to update the System Runtime Context or AsyncProcessor requestor type context.

 

  1. Trace the Job scheduler.

Similar to agent tracing, you can trace your Job scheduler from the admin studio.

2. Disable the Job Scheduler from admin studio.

You can use the Override link, to disable any running Job Scheduler. I just clicked the override link and you see it is disabled and next run is not applicable.

There may be some scenarios where you need to disable the job schedulers.

 

How to start / stop jobs using Pega API?

Step 1: Switch to admin studio -> resources -> APIs

You can find the APIs for job schedulers, queue processors.

Note: Somehow try it yourself option from admin studio is not working as expected.

Step 2: Switch to dev studio and open the service package – api

Find the service REST and open it.

Important note: For now, I disabled the TLS/SSL setting in the service package instance since my personal edition is on http. In real time you will not perform this action 🙂

Step 3: You will find the service REST supports node ID and Job ID in the resource path.

POST action to start the job and DELETE action to stop the job.

Step 4: Start the job using devops API.

Open postman and copy the URL.

In the resource path – Node ID = all and pass the Job ID name.

Note: As per the API documentation, in node ID parameter it accepts only ‘all’

I also added the basic authentication operator ID & password.

Select the POST method.

 

 

How to replace agent with the Job scheduler rule?

It is pretty simple.

Step 1: Create a new Job scheduler, use the same agent activity and configure the right schedule.

Step 2: Open the agent rule and disable.

Important note: When you change the configuration in the agent rule, make sure to delete the agent schedule instance so that it gets recreated with the updated configuration.

As a short recap,

  • Job Scheduler is introduced in Pega 8 version and set to replace the advanced agent.
  • Job Schedulers provide better performance and easy to maintain comparing the agents.
  • They get rule resolved against the AsyncProcessor requestor type context in 8.1 and 8.2 and again System Runtime Context from 8.3 onwards.
  • Most of the schedule and associated node configurations resemble same like the agent configuration.
  • System defaults the Job scheduler thread pool size to 5. By updating prConfig file, you can increase the thread pool size if you need to run more than Job Schedulers at the same time.
  • Pega 0118 can be generated if the Job schedulers run beyond the configured threshold.
  • Using the admin studio Job landing page, you can easily enable, disable or trace the Jobs.
  • You can also use the OOTB Pega APIs to enable/disable the Job schedulers using a service call.

 

 

 

 

Comments

Popular posts from this blog

Queue processor FAQ

pega-8-activity-html-page