Skip to main content

IDP Scheduler

Overview

The IDP Scheduler is used to repeatedly execute the tasks within the time interval.

This feature enables to run a business logic repeatedly at a particular interval of time which could be set during the registration of a scheduler.

Schedulers are a core feature of keycloak and are provided as an option to be extended by developers.

note

The IDP Scheduler does not support Connector Events scheduler. However, the Dead User Event Scheduler, Dead Event Cleaner Scheduler, and Basic Scheduler can be executed in the IDP Scheduler.

Benefits

Job Scheduling: This is another area of strength in IDP Scheduler. User can plan jobs to run in the future, which is particularly easy for postponing heavy tasks to the times when the system is less busy. Additionally, this scheduling capability will ensure crucial operations take place at specific intervals.

Automatic Error Recovery: IDP Scheduler comes with in-built error handling and retry options. If a task fails temporarily, the IDP Scheduler can automatically make repeated attempts based on the defined retry policy, which increase the chances of success.

Efficient Parallel Processing: The library can handle multiple background tasks simultaneously. It utilizes multi-core processors to process tasks faster and more efficiently, reducing execution time.

Smart Queue Management: IDP Scheduler takes care of managing and processing task queues, ensuring that jobs are processed in the right order, based on the application's requirements.

How to configure the Schedulers?

  1. Navigate to the Schedulers in IDP.

IDP_Scheduler

  1. Select the type of Scheduler and time interval to be executed.

  2. Click on the OK button.

IDP_Scheduler_execution

IDP - Scheduler

Schedulers provide the following provider and provider factory to be extended.

SchedulerProvider
SchedulerProviderFactory


Any new scheduler must be registered under the IDP admin dashboard, as shown in following image.


Scheduler Creation


Registered schedulers will be listed under Scheduler Service providers of server info in the mID admin dashboard, as shown in following image.


Scheduler Search


Dead User Event Scheduler

Dead User Events Scheduler to Listen for New Scheduler. This Event Scheduler allows the user and activation code to be produced in SSMS while they are already in IAM. Dead user events occur during user migration or due to SSMS connectivity issues. Based on the following name, a realm setting is introduced for storing the dead event pool, incase there's an issue while adding them to the system. If the value is set to true, the failed items will no longer be sent to the dead event pool.

Dead User Event Scheduler

Dead Event Cleaner Scheduler

Based on the specified deadEventTTL value in realm settings, the New Scheduler Dead Event Cleaner Scheduler will completely remove all dead events from the database. deadEventTTL: This controls the deletion of dead events based on timestamps, and the value should be a non-zero integer number in Days. If nothing is supplied, the value defaults to 7, i.e., seven days. If you set deadEventTTL to 2, for example. When you register the Dead Event Cleanup Scheduler, it will delete all of the dead events that were generated two days ago from the database.

Dead Event Cleaner Scheduler

Connector Events Scheduler

Connector Events Scheduler can now subscribe to numerous events as comma-separated values in the deviceEvents option under Realm Settings. For example, to subscribe to both events, use NEW_DEVICE and DEVICE_DELETION. All supported events will be unsubscribed when the scheduler is removed.

NEW_DEVICE - When we subscribe to this type of event, we get a callback after a new device is activated, i.e. registration.

DEVICE_DELETION - When we subscribe to this type of event, we get a callback when a device is removed.

Connector Events Scheduler

info

The event type for 'deviceEvents' can be set to a single event or several events separated by a comma, such as NEW_DEVICE and DEVICE_DELETION. NEW_DEVICE will be subscribed by default if 'deviceEvents' is not added or left null.