Integrate with Spring Tasks

Updated at:

This document describes how to integrate your existing Spring Tasks with the SchedulerX task scheduling platform and the advantages of doing so.

Background information

Spring Task provides a convenient way to implement scheduled tasks in the Java ecosystem, but has limitations in enterprise scenarios. By integrating with SchedulerX task scheduling, you can gain these enterprise-grade capabilities without modifying your existing task logic.

Procedure

To learn how to integrate Spring Tasks with the SchedulerX task scheduling platform, see Spring Tasks.

Advantages

Web console

SchedulerX provides a web console where you can dynamically add, modify, enable, and disable tasks. It also supports operations such as running a task once, rerunning, backfilling, stopping a task, and marking a task as successful.

The Overview page in the SchedulerX console includes the Professional Edition Task Summary (Total Tasks, Enabled Tasks, Disabled Tasks, Online Workers, and Current Running Task Instances) and the Professional Edition Task Instance Summary (Trigger Count, Successful Executions, Failed Executions, and corresponding trend charts). The right side of the page displays the Resource Overview, Product News, Sample Projects, and Quick Start modules.

Visual online troubleshooting

You can view execution history, query business logs, and trace task executions from end to end.

On the Execution List page, the Task Instance List tab displays a table with columns for Task ID/Name (e.g., SpringScheduler_test02), Task Type/Execution Mode (e.g., standalone), Instance ID, Application ID, and Status (Success or Failure). When you select a task, the Log Query panel opens on the right, where you can filter execution logs by search fields and a date range. The log content includes a timestamp, log level (INFO), executionId, thread name, and business log messages, such as hello world. start and hello world. end.

On the Trace page, you can view a diagnostic summary and detailed trace of the task execution. The top of the page has two tabs: Trace and Business Trace. The trace shows the time consumed by each method. For example, the SimpleHelloProcessor.process method takes 3.00s, accounting for 95.40% of the total time, while the internal HTTP /hello call it triggers takes 3ms.

Flexible alerting

SchedulerX offers flexible alerting with notifications via SMS, phone, email, and webhook. You can dynamically configure alert contacts, contact groups, and view alert history in the web console.

In the left-side navigation pane, choose Notification Management > Notification Contacts to add and manage alert contacts and contact groups. You can configure notification channels like SMS, phone, email, and webhook for each contact. On the Task Management page, select a target task and view its details. In the alert configuration area, you can set up rules for failure alerts and timeout alerts, and assign an alert contact group.

In the left-side navigation pane, choose Notification Management > Notification History to filter alert records by application, notification status, and time range. The list displays information such as the task name, notification type (e.g., failure alert), channel (e.g., webhook), status (Success/Failure), and notification time. Alert records are retained for 15 days.

Other advantages

  • Platform integration without code refactoring.

  • Eliminates the need to operate and maintain a separate task scheduling platform or third-party components.

  • Provides high reliability for clustered tasks, preventing duplicate executions common in the native framework and enabling automatic failover.

  • Multiple teams can share a single platform, using namespaces and application groups to isolate each team's task data and environment.